Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorMarco Stornelli2020-04-09 12:37:02 +0000
committerMarco Stornelli2020-04-10 15:57:36 +0000
commitab1c2b08897a4540bdefb3622d31dbfaee208c03 (patch)
treee1c99ee8ede6518fc45534be79331eb72796e2fa /core
parent2a0bc541f0ec5d8cc3fbd09e3ef6200e33624e93 (diff)
downloadorg.eclipse.cdt-ab1c2b08897a4540bdefb3622d31dbfaee208c03.tar.gz
org.eclipse.cdt-ab1c2b08897a4540bdefb3622d31dbfaee208c03.tar.xz
org.eclipse.cdt-ab1c2b08897a4540bdefb3622d31dbfaee208c03.zip
Bug 561770 - Rework API new class creation wizard page
Diffstat (limited to 'core')
-rw-r--r--core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java28
1 files changed, 20 insertions, 8 deletions
diff --git a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java
index a6f7716abc0..7a929531e3b 100644
--- a/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java
+++ b/core/org.eclipse.cdt.ui/src/org/eclipse/cdt/ui/wizards/NewClassCreationWizardPage.java
@@ -136,8 +136,6 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
protected static final int TEST_FILE_ID = 128;
/** @since 7.0*/
protected static final int FINAL_ID = 256;
- protected static final int ALL_FIELDS = SOURCE_FOLDER_ID | NAMESPACE_ID | CLASS_NAME_ID | BASE_CLASSES_ID
- | METHOD_STUBS_ID | HEADER_FILE_ID | SOURCE_FILE_ID | TEST_FILE_ID | FINAL_ID;
protected int fLastFocusedField = 0;
protected StringButtonDialogField fSourceFolderDialogField;
@@ -268,9 +266,6 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
// -------- UI Creation ---------
- /* (non-Javadoc)
- * @see org.eclipse.jface.dialogs.IDialogPage#createControl(org.eclipse.swt.widgets.Composite)
- */
@Override
public void createControl(Composite parent) {
initializeDialogUnits(parent);
@@ -529,7 +524,7 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
fIsFinalClassField.setSelection(fDialogSettings.getBoolean(KEY_FINAL_SELECTED));
setTestFileSelection(fDialogSettings.getBoolean(KEY_TEST_FILE_SELECTED), true);
- handleFieldChanged(ALL_FIELDS);
+ handleFieldsChanged();
}
private boolean getBooleanSettingWithDefault(String key, boolean defaultValue) {
@@ -1085,13 +1080,13 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
IPath newFolderPath = chooseSourceFolder(oldFolderPath);
if (newFolderPath != null) {
setSourceFolderFullPath(newFolderPath, false);
- handleFieldChanged(SOURCE_FOLDER_ID | ALL_FIELDS);
+ handleFieldsChanged();
}
}
@Override
public void dialogFieldChanged(DialogField field) {
- handleFieldChanged(SOURCE_FOLDER_ID | ALL_FIELDS);
+ handleFieldsChanged();
}
}
@@ -1531,6 +1526,23 @@ public class NewClassCreationWizardPage extends NewElementWizardPage {
doStatusUpdate();
}
+ /**
+ * Hook method that gets called when all fields on this page have changed.
+ * @since 7.0
+ */
+ protected void handleFieldsChanged() {
+ fSourceFolderStatus = sourceFolderChanged();
+ fNamespaceStatus = namespaceChanged();
+ fClassNameStatus = classNameChanged();
+ fBaseClassesStatus = baseClassesChanged();
+ fMethodStubsStatus = methodStubsChanged();
+ fHeaderFileStatus = headerFileChanged();
+ fSourceFileStatus = sourceFileChanged();
+ fTestFileStatus = testFileChanged();
+ fIsFinalStatus = finalChanged();
+ doStatusUpdate();
+ }
+
private boolean fieldChanged(int fields, int fieldID) {
return ((fields & fieldID) != 0);
}

Back to the top