diff options
author | jonas | 2014-10-06 08:00:34 +0000 |
---|---|---|
committer | jonas | 2014-10-06 08:00:34 +0000 |
commit | 4a836cde14c4df5a7565bb346787b308f9c5b8a2 (patch) | |
tree | 167782441bf9898b33a2c39bb19c0e68023a55cd | |
parent | cffdf03b5c537d92f46debe539d7a0632ca42b5a (diff) | |
download | org.eclipse.e4.tools-4a836cde14c4df5a7565bb346787b308f9c5b8a2.tar.gz org.eclipse.e4.tools-4a836cde14c4df5a7565bb346787b308f9c5b8a2.tar.xz org.eclipse.e4.tools-4a836cde14c4df5a7565bb346787b308f9c5b8a2.zip |
Bug 444340 - Externalize StringsI20141006-2200I20141006-0900
5 files changed, 225 insertions, 178 deletions
diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/Messages.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/Messages.java index ed3c140b..acfee216 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/Messages.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/Messages.java @@ -36,6 +36,20 @@ public class Messages extends NLS { public static String NewDynamicMenuContributionClassWizard_AboutToShowMethod; public static String NewDynamicMenuContributionClassWizard_CreateNewContribution; public static String NewDynamicMenuContributionClassWizard_NewDynamicContribution; + public static String NewHandlerClassWizard_CanExecuteMethod; + public static String NewHandlerClassWizard_CreateNewHandler; + public static String NewHandlerClassWizard_ExecuteMethod; + public static String NewHandlerClassWizard_NewHandler; + public static String NewPartClassWizard_CreateNewPart; + public static String NewPartClassWizard_FocusMethod; + public static String NewPartClassWizard_NewPart; + public static String NewPartClassWizard_PersistMethod; + public static String NewPartClassWizard_PostConstructMethod; + public static String NewPartClassWizard_PredestroyMethod; + public static String NewToolControlClassWizard_CreateDefaultConstructor; + public static String NewToolControlClassWizard_CreateGUIMethod; + public static String NewToolControlClassWizard_CreateNewToolControl; + public static String NewToolControlClassWizard_NewToolControl; static { // initialize resource bundle NLS.initializeMessages(BUNDLE_NAME, Messages.class); diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/messages.properties b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/messages.properties index 71a6932e..828c0c63 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/messages.properties +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/messages.properties @@ -15,3 +15,17 @@ NewAddonClassWizard_NewAddonClass=Create a new addon class NewDynamicMenuContributionClassWizard_AboutToShowMethod=AboutToShow Method NewDynamicMenuContributionClassWizard_CreateNewContribution=Create a new dynamic menu contribution class NewDynamicMenuContributionClassWizard_NewDynamicContribution=New Dynamic Menu Contribution +NewHandlerClassWizard_CanExecuteMethod=Can-Execute Method +NewHandlerClassWizard_CreateNewHandler=Create a new handler class +NewHandlerClassWizard_ExecuteMethod=Execute Method +NewHandlerClassWizard_NewHandler=New Handler +NewPartClassWizard_CreateNewPart=Create a new part class +NewPartClassWizard_FocusMethod=Focus Method +NewPartClassWizard_NewPart=New Part +NewPartClassWizard_PersistMethod=Persist Method +NewPartClassWizard_PostConstructMethod=PostContruct Method +NewPartClassWizard_PredestroyMethod=Predestroy Method +NewToolControlClassWizard_CreateDefaultConstructor=Create Default Constructor +NewToolControlClassWizard_CreateGUIMethod=Create GUI Method +NewToolControlClassWizard_CreateNewToolControl=Create a new tool control class +NewToolControlClassWizard_NewToolControl=New Tool Control diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewHandlerClassWizard.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewHandlerClassWizard.java index 244b498e..9c675f96 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewHandlerClassWizard.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewHandlerClassWizard.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - * Sopot Cela <sopotcela@gmail.com> + * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation + * Sopot Cela <sopotcela@gmail.com> ******************************************************************************/ package org.eclipse.e4.internal.tools.wizards.classes; @@ -16,6 +16,7 @@ import java.util.Set; import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.databinding.beans.BeanProperties; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.e4.internal.tools.Messages; import org.eclipse.e4.internal.tools.wizards.classes.AbstractNewClassPage.JavaClass; import org.eclipse.e4.internal.tools.wizards.classes.templates.HandlerTemplate; import org.eclipse.jdt.core.IPackageFragmentRoot; @@ -29,27 +30,32 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; public class NewHandlerClassWizard extends AbstractNewClassWizard { + private static final String USE_CAN_EXECUTE = "useCanExecute"; //$NON-NLS-1$ + private static final String CAN_EXECUTE_METHOD_NAME = "canExecuteMethodName"; //$NON-NLS-1$ + private static final String EXECUTE_METHOD_NAME = "executeMethodName"; //$NON-NLS-1$ private String initialString; public NewHandlerClassWizard(String contributionURI) { - this.initialString = contributionURI; + initialString = contributionURI; } - + public NewHandlerClassWizard() { - // Intentially left empty + // Intentially left empty } @Override protected String getContent() { - HandlerTemplate template = new HandlerTemplate(); + final HandlerTemplate template = new HandlerTemplate(); return template.generate(getDomainClass()); } - + @Override public void addPages() { - addPage(new AbstractNewClassPage("Classinformation", - "New Handler", - "Create a new handler class", root, ResourcesPlugin.getWorkspace().getRoot(),initialString) { + addPage(new AbstractNewClassPage( + "Classinformation", //$NON-NLS-1$ + Messages.NewHandlerClassWizard_NewHandler, + Messages.NewHandlerClassWizard_CreateNewHandler, root, ResourcesPlugin.getWorkspace().getRoot(), + initialString) { @Override protected JavaClass createInstance() { @@ -58,57 +64,57 @@ public class NewHandlerClassWizard extends AbstractNewClassWizard { @Override protected void createFields(Composite parent, DataBindingContext dbc) { - IWidgetValueProperty textProp = WidgetProperties - .text(SWT.Modify); + final IWidgetValueProperty textProp = WidgetProperties + .text(SWT.Modify); { Label l = new Label(parent, SWT.NONE); - l.setText("Execute Method"); + l.setText(Messages.NewHandlerClassWizard_ExecuteMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue( - textProp.observe(t), - BeanProperties.value("executeMethodName").observe( - getClazz())); + textProp.observe(t), + BeanProperties.value(EXECUTE_METHOD_NAME).observe( + getClazz())); l = new Label(parent, SWT.NONE); } { - Label l = new Label(parent, SWT.NONE); - l.setText("Can-Execute Method"); + final Label l = new Label(parent, SWT.NONE); + l.setText(Messages.NewHandlerClassWizard_CanExecuteMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue(textProp.observe(t), - BeanProperties.value("canExecuteMethodName") - .observe(getClazz())); + BeanProperties.value(CAN_EXECUTE_METHOD_NAME) + .observe(getClazz())); dbc.bindValue( - WidgetProperties.enabled().observe(t), - BeanProperties.value("useCanExecute").observe( - getClazz())); + WidgetProperties.enabled().observe(t), + BeanProperties.value(USE_CAN_EXECUTE).observe( + getClazz())); - Button b = new Button(parent, SWT.CHECK); + final Button b = new Button(parent, SWT.CHECK); dbc.bindValue( - WidgetProperties.selection().observe(b), - BeanProperties.value("useCanExecute").observe( - getClazz())); + WidgetProperties.selection().observe(b), + BeanProperties.value(USE_CAN_EXECUTE).observe( + getClazz())); } } }); } - + @Override protected Set<String> getRequiredBundles() { - Set<String> set = super.getRequiredBundles(); - set.add("org.eclipse.e4.core.di"); + final Set<String> set = super.getRequiredBundles(); + set.add("org.eclipse.e4.core.di"); //$NON-NLS-1$ return set; } - + public static class HandlerClass extends JavaClass { - private String executeMethodName = "execute"; - private String canExecuteMethodName = "canExecute"; + private String executeMethodName = "execute"; //$NON-NLS-1$ + private String canExecuteMethodName = "canExecute"; //$NON-NLS-1$ private boolean useCanExecute = false; public HandlerClass(IPackageFragmentRoot root) { @@ -120,9 +126,9 @@ public class NewHandlerClassWizard extends AbstractNewClassWizard { } public void setExecuteMethodName(String executeMethodName) { - support.firePropertyChange("executeMethodName", - this.executeMethodName, - this.executeMethodName = executeMethodName); + support.firePropertyChange(EXECUTE_METHOD_NAME, + this.executeMethodName, + this.executeMethodName = executeMethodName); } public String getCanExecuteMethodName() { @@ -130,9 +136,9 @@ public class NewHandlerClassWizard extends AbstractNewClassWizard { } public void setCanExecuteMethodName(String canExecuteMethodName) { - support.firePropertyChange("canExecuteMethodName", - this.canExecuteMethodName, - this.canExecuteMethodName = canExecuteMethodName); + support.firePropertyChange(CAN_EXECUTE_METHOD_NAME, + this.canExecuteMethodName, + this.canExecuteMethodName = canExecuteMethodName); } public boolean isUseCanExecute() { @@ -140,8 +146,8 @@ public class NewHandlerClassWizard extends AbstractNewClassWizard { } public void setUseCanExecute(boolean useCanExecute) { - support.firePropertyChange("useCanExecute", this.useCanExecute, - this.useCanExecute = useCanExecute); + support.firePropertyChange(USE_CAN_EXECUTE, this.useCanExecute, + this.useCanExecute = useCanExecute); } } } diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewPartClassWizard.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewPartClassWizard.java index a28c2d01..e82ad118 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewPartClassWizard.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewPartClassWizard.java @@ -6,8 +6,8 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation - * Sopot Cela <sopotcela@gmail.com> + * Tom Schindl <tom.schindl@bestsolution.at> - initial API and implementation + * Sopot Cela <sopotcela@gmail.com> ******************************************************************************/ package org.eclipse.e4.internal.tools.wizards.classes; @@ -18,6 +18,7 @@ import java.util.Set; import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.databinding.beans.BeanProperties; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.e4.internal.tools.Messages; import org.eclipse.e4.internal.tools.wizards.classes.AbstractNewClassPage.JavaClass; import org.eclipse.e4.internal.tools.wizards.classes.templates.PartTemplate; import org.eclipse.jdt.core.IPackageFragmentRoot; @@ -32,110 +33,118 @@ import org.eclipse.swt.widgets.Text; public class NewPartClassWizard extends AbstractNewClassWizard { + private static final String PERSIST_METHOD_NAME = "persistMethodName"; //$NON-NLS-1$ + private static final String USE_PERSIST = "usePersist"; //$NON-NLS-1$ + private static final String USE_FOCUS = "useFocus"; //$NON-NLS-1$ + private static final String FOCUS_METHOD_NAME = "focusMethodName"; //$NON-NLS-1$ + private static final String USE_PREDESTROY = "usePredestroy"; //$NON-NLS-1$ + private static final String PRE_DESTROY_METHOD_NAME = "preDestroyMethodName"; //$NON-NLS-1$ + private static final String USE_POST_CONSTRUCT = "usePostConstruct"; //$NON-NLS-1$ + private static final String POST_CONSTRUCT_METHOD_NAME = "postConstructMethodName"; //$NON-NLS-1$ private String initialString; public NewPartClassWizard(String contributionURI) { - this.initialString = contributionURI; + initialString = contributionURI; } - + public NewPartClassWizard() { - // Intentially left empty + // Intentially left empty } @Override public void addPages() { - addPage(new AbstractNewClassPage("Classinformation", "New Part", - "Create a new part class", root, ResourcesPlugin.getWorkspace() - .getRoot(), initialString) { + addPage(new AbstractNewClassPage("Classinformation", Messages.NewPartClassWizard_NewPart, //$NON-NLS-1$ + Messages.NewPartClassWizard_CreateNewPart, root, ResourcesPlugin.getWorkspace() + .getRoot(), initialString) { @Override protected void createFields(Composite parent, DataBindingContext dbc) { - IWidgetValueProperty textProp = WidgetProperties - .text(SWT.Modify); - IWidgetValueProperty enabledProp = WidgetProperties.enabled(); + final IWidgetValueProperty textProp = WidgetProperties + .text(SWT.Modify); + final IWidgetValueProperty enabledProp = WidgetProperties.enabled(); { - Label l = new Label(parent, SWT.NONE); - l.setText("PostContruct Method"); + final Label l = new Label(parent, SWT.NONE); + l.setText(Messages.NewPartClassWizard_PostConstructMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue(textProp.observe(t), - BeanProperties.value("postConstructMethodName") - .observe(getClazz())); + BeanProperties.value(POST_CONSTRUCT_METHOD_NAME) + .observe(getClazz())); dbc.bindValue( - enabledProp.observe(t), - BeanProperties.value("usePostConstruct").observe( - getClazz())); + enabledProp.observe(t), + BeanProperties.value(USE_POST_CONSTRUCT).observe( + getClazz())); - Button b = new Button(parent, SWT.CHECK); + final Button b = new Button(parent, SWT.CHECK); dbc.bindValue( - WidgetProperties.selection().observe(b), - BeanProperties.value("usePostConstruct").observe( - getClazz())); + WidgetProperties.selection().observe(b), + BeanProperties.value(USE_POST_CONSTRUCT).observe( + getClazz())); } - + { - Label l = new Label(parent, SWT.NONE); - l.setText("Predestroy Method"); + final Label l = new Label(parent, SWT.NONE); + l.setText(Messages.NewPartClassWizard_PredestroyMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue(textProp.observe(t), - BeanProperties.value("preDestroyMethodName") - .observe(getClazz())); + BeanProperties.value(PRE_DESTROY_METHOD_NAME) + .observe(getClazz())); dbc.bindValue( - enabledProp.observe(t), - BeanProperties.value("usePredestroy").observe( - getClazz())); + enabledProp.observe(t), + BeanProperties.value(USE_PREDESTROY).observe( + getClazz())); - Button b = new Button(parent, SWT.CHECK); + final Button b = new Button(parent, SWT.CHECK); dbc.bindValue( - WidgetProperties.selection().observe(b), - BeanProperties.value("usePredestroy").observe( - getClazz())); + WidgetProperties.selection().observe(b), + BeanProperties.value(USE_PREDESTROY).observe( + getClazz())); } - + { - Label l = new Label(parent, SWT.NONE); - l.setText("Focus Method"); + final Label l = new Label(parent, SWT.NONE); + l.setText(Messages.NewPartClassWizard_FocusMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue(textProp.observe(t), - BeanProperties.value("focusMethodName") - .observe(getClazz())); + BeanProperties.value(FOCUS_METHOD_NAME) + .observe(getClazz())); dbc.bindValue( - enabledProp.observe(t), - BeanProperties.value("useFocus").observe( - getClazz())); + enabledProp.observe(t), + BeanProperties.value(USE_FOCUS).observe( + getClazz())); - Button b = new Button(parent, SWT.CHECK); + final Button b = new Button(parent, SWT.CHECK); dbc.bindValue( - WidgetProperties.selection().observe(b), - BeanProperties.value("useFocus").observe( - getClazz())); + WidgetProperties.selection().observe(b), + BeanProperties.value(USE_FOCUS).observe( + getClazz())); } - + { - Label l = new Label(parent, SWT.NONE); - l.setText("Persist Method"); + final Label l = new Label(parent, SWT.NONE); + l.setText(Messages.NewPartClassWizard_PersistMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue(textProp.observe(t), - BeanProperties.value("persistMethodName") - .observe(getClazz())); + BeanProperties.value(PERSIST_METHOD_NAME) + .observe(getClazz())); dbc.bindValue( - enabledProp.observe(t), - BeanProperties.value("usePersist").observe( - getClazz())); + enabledProp.observe(t), + BeanProperties.value(USE_PERSIST).observe( + getClazz())); - Button b = new Button(parent, SWT.CHECK); + final Button b = new Button(parent, SWT.CHECK); dbc.bindValue( - WidgetProperties.selection().observe(b), - BeanProperties.value("usePersist").observe( - getClazz())); + WidgetProperties.selection().observe(b), + BeanProperties.value(USE_PERSIST).observe( + getClazz())); } } @@ -146,45 +155,46 @@ public class NewPartClassWizard extends AbstractNewClassWizard { }); } - + @Override protected Set<String> getRequiredBundles() { - Set<String> rv = super.getRequiredBundles(); - PartClass cl = (PartClass)getDomainClass(); - if( cl.usePostConstruct || cl.usePredestroy ) { - rv.add("javax.annotation"); - } else if( cl.useFocus || cl.usePersist ) { - rv.add("org.eclipse.e4.ui.di"); + final Set<String> rv = super.getRequiredBundles(); + final PartClass cl = (PartClass) getDomainClass(); + if (cl.usePostConstruct || cl.usePredestroy) { + rv.add("javax.annotation"); //$NON-NLS-1$ + } else if (cl.useFocus || cl.usePersist) { + rv.add("org.eclipse.e4.ui.di"); //$NON-NLS-1$ } - + return rv; } - + @Override protected String getContent() { - PartTemplate template = new PartTemplate(); + final PartTemplate template = new PartTemplate(); return template.generate(getDomainClass()); } public static class PartClass extends JavaClass { - private PropertyChangeSupport support = new PropertyChangeSupport(this); + + private final PropertyChangeSupport support = new PropertyChangeSupport(this); private boolean usePostConstruct = true; - private String postConstructMethodName = "postConstruct"; + private String postConstructMethodName = "postConstruct"; //$NON-NLS-1$ private boolean usePredestroy; - private String preDestroyMethodName = "preDestroy"; + private String preDestroyMethodName = "preDestroy"; //$NON-NLS-1$ private boolean useFocus; - private String focusMethodName = "onFocus"; + private String focusMethodName = "onFocus"; //$NON-NLS-1$ private boolean usePersist; - private String persistMethodName = "save"; + private String persistMethodName = "save"; //$NON-NLS-1$ public PartClass(IPackageFragmentRoot fragmentRoot) { super(fragmentRoot); } - + @Override public void addPropertyChangeListener(PropertyChangeListener listener) { support.addPropertyChangeListener(listener); @@ -200,9 +210,9 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setUsePostConstruct(boolean usePostConstruct) { - support.firePropertyChange("usePostConstruct", - this.usePostConstruct, - this.usePostConstruct = usePostConstruct); + support.firePropertyChange(USE_POST_CONSTRUCT, + this.usePostConstruct, + this.usePostConstruct = usePostConstruct); } public String getPostConstructMethodName() { @@ -210,9 +220,9 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setPostConstructMethodName(String postConstructMethodName) { - support.firePropertyChange("postConstructMethodName", - this.postConstructMethodName, - this.postConstructMethodName = postConstructMethodName); + support.firePropertyChange(POST_CONSTRUCT_METHOD_NAME, + this.postConstructMethodName, + this.postConstructMethodName = postConstructMethodName); } public boolean isUsePredestroy() { @@ -220,8 +230,8 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setUsePredestroy(boolean usePredestroy) { - support.firePropertyChange("usePredestroy", this.usePredestroy, - this.usePredestroy = usePredestroy); + support.firePropertyChange(USE_PREDESTROY, this.usePredestroy, + this.usePredestroy = usePredestroy); } public String getPreDestroyMethodName() { @@ -229,9 +239,9 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setPreDestroyMethodName(String preDestroyMethodName) { - support.firePropertyChange("preDestroyMethodName", - this.preDestroyMethodName, - this.preDestroyMethodName = preDestroyMethodName); + support.firePropertyChange(PRE_DESTROY_METHOD_NAME, + this.preDestroyMethodName, + this.preDestroyMethodName = preDestroyMethodName); } public boolean isUseFocus() { @@ -239,8 +249,8 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setUseFocus(boolean useFocus) { - support.firePropertyChange("useFocus", this.useFocus, - this.useFocus = useFocus); + support.firePropertyChange(USE_FOCUS, this.useFocus, + this.useFocus = useFocus); } public String getFocusMethodName() { @@ -248,8 +258,8 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setFocusMethodName(String focusMethodName) { - support.firePropertyChange("focusMethodName", this.focusMethodName, - this.focusMethodName = focusMethodName); + support.firePropertyChange(FOCUS_METHOD_NAME, this.focusMethodName, + this.focusMethodName = focusMethodName); } public boolean isUsePersist() { @@ -257,8 +267,8 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setUsePersist(boolean usePersist) { - support.firePropertyChange("usePersist", this.usePersist, - this.usePersist = usePersist); + support.firePropertyChange(USE_PERSIST, this.usePersist, + this.usePersist = usePersist); } public String getPersistMethodName() { @@ -266,9 +276,9 @@ public class NewPartClassWizard extends AbstractNewClassWizard { } public void setPersistMethodName(String persistMethodName) { - support.firePropertyChange("persistMethodName", - this.persistMethodName, - this.persistMethodName = persistMethodName); + support.firePropertyChange(PERSIST_METHOD_NAME, + this.persistMethodName, + this.persistMethodName = persistMethodName); } } } diff --git a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewToolControlClassWizard.java b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewToolControlClassWizard.java index 43804f70..ccb1f029 100644 --- a/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewToolControlClassWizard.java +++ b/bundles/org.eclipse.e4.tools/src/org/eclipse/e4/internal/tools/wizards/classes/NewToolControlClassWizard.java @@ -6,7 +6,7 @@ * http://www.eclipse.org/legal/epl-v10.html * * Contributors: - * Dmitry Spiridenok <d.spiridenok@gmail.com> - Bug 412672 + * Dmitry Spiridenok <d.spiridenok@gmail.com> - Bug 412672 ******************************************************************************/ package org.eclipse.e4.internal.tools.wizards.classes; @@ -15,6 +15,7 @@ import java.util.Set; import org.eclipse.core.databinding.DataBindingContext; import org.eclipse.core.databinding.beans.BeanProperties; import org.eclipse.core.resources.ResourcesPlugin; +import org.eclipse.e4.internal.tools.Messages; import org.eclipse.e4.internal.tools.wizards.classes.AbstractNewClassPage.JavaClass; import org.eclipse.e4.internal.tools.wizards.classes.templates.ToolControlTemplate; import org.eclipse.jdt.core.IPackageFragmentRoot; @@ -28,10 +29,12 @@ import org.eclipse.swt.widgets.Label; import org.eclipse.swt.widgets.Text; public class NewToolControlClassWizard extends AbstractNewClassWizard { + private static final String CREATE_DEFAULT_CONSTRUCTOR = "createDefaultConstructor"; //$NON-NLS-1$ + private static final String CREATE_GUI_METHOD_NAME = "createGuiMethodName"; //$NON-NLS-1$ private String initialString; public NewToolControlClassWizard(String contributionURI) { - this.initialString = contributionURI; + initialString = contributionURI; } public NewToolControlClassWizard() { @@ -40,15 +43,15 @@ public class NewToolControlClassWizard extends AbstractNewClassWizard { @Override protected String getContent() { - ToolControlTemplate template = new ToolControlTemplate(); + final ToolControlTemplate template = new ToolControlTemplate(); return template.generate(getDomainClass()); } @Override public void addPages() { - addPage(new AbstractNewClassPage("Classinformation", - "New Tool Control", - "Create a new tool control class", root, ResourcesPlugin.getWorkspace().getRoot(),initialString) { + addPage(new AbstractNewClassPage("Classinformation", //$NON-NLS-1$ + Messages.NewToolControlClassWizard_NewToolControl, + Messages.NewToolControlClassWizard_CreateNewToolControl, root, ResourcesPlugin.getWorkspace().getRoot(), initialString) { @Override protected JavaClass createInstance() { @@ -57,39 +60,39 @@ public class NewToolControlClassWizard extends AbstractNewClassWizard { @Override protected void createFields(Composite parent, DataBindingContext dbc) { - IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify); + final IWidgetValueProperty textProp = WidgetProperties.text(SWT.Modify); { Label l = new Label(parent, SWT.NONE); - l.setText("Create GUI Method"); + l.setText(Messages.NewToolControlClassWizard_CreateGUIMethod); - Text t = new Text(parent, SWT.BORDER); + final Text t = new Text(parent, SWT.BORDER); t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); dbc.bindValue( - textProp.observe(t), - BeanProperties.value("createGuiMethodName").observe( - getClazz())); + textProp.observe(t), + BeanProperties.value(CREATE_GUI_METHOD_NAME).observe( + getClazz())); l = new Label(parent, SWT.NONE); } { - Label l = new Label(parent, SWT.NONE); - l.setText("Create Default Constructor"); - -// Text t = new Text(parent, SWT.BORDER); -// t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); -// dbc.bindValue(textProp.observe(t), -// BeanProperties.value("defaultConstructorName") -// .observe(getClazz())); -// dbc.bindValue( -// WidgetProperties.enabled().observe(t), -// BeanProperties.value("useDefaultConstructor").observe( -// getClazz())); - - Button b = new Button(parent, SWT.CHECK); + final Label l = new Label(parent, SWT.NONE); + l.setText(Messages.NewToolControlClassWizard_CreateDefaultConstructor); + + // Text t = new Text(parent, SWT.BORDER); + // t.setLayoutData(new GridData(GridData.FILL_HORIZONTAL)); + // dbc.bindValue(textProp.observe(t), + // BeanProperties.value("defaultConstructorName") + // .observe(getClazz())); + // dbc.bindValue( + // WidgetProperties.enabled().observe(t), + // BeanProperties.value("useDefaultConstructor").observe( + // getClazz())); + + final Button b = new Button(parent, SWT.CHECK); dbc.bindValue( - WidgetProperties.selection().observe(b), - BeanProperties.value("createDefaultConstructor").observe( - getClazz())); + WidgetProperties.selection().observe(b), + BeanProperties.value(CREATE_DEFAULT_CONSTRUCTOR).observe( + getClazz())); } } }); @@ -97,13 +100,13 @@ public class NewToolControlClassWizard extends AbstractNewClassWizard { @Override protected Set<String> getRequiredBundles() { - Set<String> set = super.getRequiredBundles(); - set.add("org.eclipse.e4.core.di"); + final Set<String> set = super.getRequiredBundles(); + set.add("org.eclipse.e4.core.di"); //$NON-NLS-1$ return set; } public static class ToolControlClass extends JavaClass { - private String createGuiMethodName = "createGui"; + private String createGuiMethodName = "createGui"; //$NON-NLS-1$ private boolean createDefaultCostructor = false; public ToolControlClass(IPackageFragmentRoot root) { @@ -115,9 +118,9 @@ public class NewToolControlClassWizard extends AbstractNewClassWizard { } public void setCreateGuiMethodName(String createGuiMethodName) { - support.firePropertyChange("createGuiMethodName", - this.createGuiMethodName, - this.createGuiMethodName = createGuiMethodName); + support.firePropertyChange(CREATE_GUI_METHOD_NAME, + this.createGuiMethodName, + this.createGuiMethodName = createGuiMethodName); } public boolean isCreateDefaultConstructor() { @@ -125,8 +128,8 @@ public class NewToolControlClassWizard extends AbstractNewClassWizard { } public void setCreateDefaultConstructor(boolean createDefaultConstructor) { - support.firePropertyChange("createDefaultConstructor", this.createDefaultCostructor, - this.createDefaultCostructor = createDefaultConstructor); + support.firePropertyChange(CREATE_DEFAULT_CONSTRUCTOR, createDefaultCostructor, + createDefaultCostructor = createDefaultConstructor); } } } |