summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteffen Kriese2011-04-15 03:43:01 (EDT)
committerSteffen Kriese2011-04-15 03:43:01 (EDT)
commit907b08d4a1a880b45ccfe4274f4f1ae132e54807 (patch)
tree7ba711af18a4d0ff5f5e0b63a7d14516d076ca0d
parent99d4041c16c9e4ae0505be6470cc8113b4300626 (diff)
downloadorg.eclipse.riena.toolbox-907b08d4a1a880b45ccfe4274f4f1ae132e54807.zip
org.eclipse.riena.toolbox-907b08d4a1a880b45ccfe4274f4f1ae132e54807.tar.gz
org.eclipse.riena.toolbox-907b08d4a1a880b45ccfe4274f4f1ae132e54807.tar.bz2
code cleaning in wizards
-rw-r--r--org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerNewWizard.java12
-rw-r--r--org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerTemplate.java51
-rw-r--r--org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/mail/MailTemplate.java3
-rw-r--r--org.eclipse.riena.ui.wizard.cs/.checkstyle2
-rw-r--r--org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaApplicationWizard.java1
-rw-r--r--org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardImages.java9
-rw-r--r--org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardMessages.java4
-rw-r--r--org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorProperties.java15
-rw-r--r--org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorUtil.java7
-rw-r--r--org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/pages/GeneralPageLayout.java1
10 files changed, 72 insertions, 33 deletions
diff --git a/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerNewWizard.java b/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerNewWizard.java
index ce3d0bb..bbeebfb 100644
--- a/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerNewWizard.java
+++ b/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerNewWizard.java
@@ -20,6 +20,7 @@ import org.eclipse.pde.ui.templates.ITemplateSection;
import org.eclipse.pde.ui.templates.NewPluginTemplateWizard;
import org.eclipse.pde.ui.templates.PluginReference;
+@SuppressWarnings("restriction")
public class ClientServerNewWizard extends NewPluginTemplateWizard {
private ClientServerTemplate csTemplate;
@@ -32,7 +33,8 @@ public class ClientServerNewWizard extends NewPluginTemplateWizard {
* org.eclipse.pde.ui.templates.AbstractNewPluginTemplateWizard#init(org
* .eclipse.pde.ui.IFieldData)
*/
- public void init(IFieldData data) {
+ @Override
+ public void init(final IFieldData data) {
super.init(data);
setWindowTitle("Riena Client/Server Template");
fieldData = data;
@@ -45,25 +47,27 @@ public class ClientServerNewWizard extends NewPluginTemplateWizard {
* org.eclipse.pde.ui.templates.NewPluginTemplateWizard#createTemplateSections
* ()
*/
+ @Override
public ITemplateSection[] createTemplateSections() {
csTemplate = new ClientServerTemplate();
return new ITemplateSection[] { csTemplate };
}
+ @Override
public String[] getImportPackages() {
return new String[] { "org.osgi.framework" };
}
@Override
- public IPluginReference[] getDependencies(String schemaVersion) {
+ public IPluginReference[] getDependencies(final String schemaVersion) {
return new IPluginReference[] { new PluginReference("org.eclipse.riena.server", null, 0),
new PluginReference("org.eclipse.riena.communication.core", null, 0) };
}
@Override
- public boolean performFinish(IProject project, IPluginModelBase model, IProgressMonitor monitor) {
+ public boolean performFinish(final IProject project, final IPluginModelBase model, final IProgressMonitor monitor) {
// do not generate default activator, there is one in the template
- PluginFieldData pdf = (PluginFieldData) fieldData;
+ final PluginFieldData pdf = (PluginFieldData) fieldData;
pdf.setDoGenerateClass(false);
return super.performFinish(project, model, monitor);
}
diff --git a/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerTemplate.java b/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerTemplate.java
index d5ed4d8..b094d08 100644
--- a/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerTemplate.java
+++ b/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/cs/ClientServerTemplate.java
@@ -23,8 +23,10 @@ import org.eclipse.pde.internal.core.bundle.BundlePluginBase;
import org.eclipse.pde.internal.core.ibundle.IBundle;
import org.eclipse.pde.ui.IFieldData;
import org.eclipse.pde.ui.templates.AbstractTemplateSection;
+
import org.eclipse.riena.ui.templates.RienaTemplateSection;
+@SuppressWarnings("restriction")
public class ClientServerTemplate extends RienaTemplateSection {
public static final String KEY_APPLICATION_CLASS = "applicationClass"; //$NON-NLS-1$
@@ -35,8 +37,9 @@ public class ClientServerTemplate extends RienaTemplateSection {
createOptions();
}
- public void addPages(Wizard wizard) {
- WizardPage page = createPage(0, "");// IHelpContextIds.TEMPLATE_RCP_MAIL);
+ @Override
+ public void addPages(final Wizard wizard) {
+ final WizardPage page = createPage(0, "");// IHelpContextIds.TEMPLATE_RCP_MAIL);
page.setTitle("Riena Client/Server Template");
page.setDescription("Creates a small Riena application, with a navigation area and one view.");
wizard.addPage(page);
@@ -47,15 +50,17 @@ public class ClientServerTemplate extends RienaTemplateSection {
addOption(KEY_PACKAGE_NAME, "Pa&ckage name:", (String) null, 0);
}
- protected void initializeFields(IFieldData data) {
+ @Override
+ protected void initializeFields(final IFieldData data) {
// In a new project wizard, we don't know this yet - the
// model has not been created
- String packageName = getFormattedPackageName(data.getId());
+ final String packageName = getFormattedPackageName(data.getId());
initializeOption(KEY_PACKAGE_NAME, packageName);
}
- public void initializeFields(IPluginModelBase model) {
- String packageName = getFormattedPackageName(model.getPluginBase().getId());
+ @Override
+ public void initializeFields(final IPluginModelBase model) {
+ final String packageName = getFormattedPackageName(model.getPluginBase().getId());
initializeOption(KEY_PACKAGE_NAME, packageName);
}
@@ -64,11 +69,13 @@ public class ClientServerTemplate extends RienaTemplateSection {
*
* @see org.eclipse.pde.ui.templates.OptionTemplateSection#getSectionId()
*/
+ @Override
public String getSectionId() {
return "cs"; //$NON-NLS-1$
}
- protected void updateModel(IProgressMonitor monitor) throws CoreException {
+ @Override
+ protected void updateModel(final IProgressMonitor monitor) throws CoreException {
// unused
}
@@ -88,6 +95,7 @@ public class ClientServerTemplate extends RienaTemplateSection {
* @seeorg.eclipse.pde.ui.templates.BaseOptionTemplateSection#
* isDependentOnParentWizard()
*/
+ @Override
public boolean isDependentOnParentWizard() {
return true;
}
@@ -99,6 +107,7 @@ public class ClientServerTemplate extends RienaTemplateSection {
* org.eclipse.pde.ui.templates.AbstractTemplateSection#getNumberOfWorkUnits
* ()
*/
+ @Override
public int getNumberOfWorkUnits() {
return super.getNumberOfWorkUnits() + 1;
}
@@ -110,31 +119,33 @@ public class ClientServerTemplate extends RienaTemplateSection {
* org.eclipse.pde.ui.templates.AbstractTemplateSection#getDependencies(
* java.lang.String)
*/
- public IPluginReference[] getDependencies(String schemaVersion) {
+ @Override
+ public IPluginReference[] getDependencies(final String schemaVersion) {
return getUIDependencies(schemaVersion);
}
@Override
- public void execute(IProject project, IPluginModelBase model, IProgressMonitor monitor) throws CoreException {
+ public void execute(final IProject project, final IPluginModelBase model, final IProgressMonitor monitor)
+ throws CoreException {
super.execute(project, model, monitor);
- String packageName = (String) getValue(AbstractTemplateSection.KEY_PACKAGE_NAME);
+ final String packageName = (String) getValue(AbstractTemplateSection.KEY_PACKAGE_NAME);
- IPluginBase pluginBase = model.getPluginBase();
- IBundle bundle = ((BundlePluginBase) pluginBase).getBundle();
- bundle.setHeader("Bundle-Activator", packageName + ".Activator");
- bundle.setHeader("Eclipse-RegisterBuddy", "org.eclipse.riena.communication.core");
- bundle.setHeader("Export-Package", packageName + ".common");
+ final IPluginBase pluginBase = model.getPluginBase();
+ final IBundle bundle = ((BundlePluginBase) pluginBase).getBundle();
+ bundle.setHeader("Bundle-Activator", packageName + ".Activator"); //$NON-NLS-1$ //$NON-NLS-2$
+ bundle.setHeader("Eclipse-RegisterBuddy", "org.eclipse.riena.communication.core"); //$NON-NLS-1$ //$NON-NLS-2$
+ bundle.setHeader("Export-Package", packageName + ".common"); //$NON-NLS-1$ //$NON-NLS-2$
- IPluginImport[] imports = pluginBase.getImports();
- for (IPluginImport pi : imports) {
- String id = pi.getId();
+ final IPluginImport[] imports = pluginBase.getImports();
+ for (final IPluginImport pi : imports) {
+ final String id = pi.getId();
// these are added by default by PDE, not needed here, remove
- if ("org.eclipse.ui".equals(id) || "org.eclipse.core.runtime".equals(id)) {
+ if ("org.eclipse.ui".equals(id) || "org.eclipse.core.runtime".equals(id)) { //$NON-NLS-1$ //$NON-NLS-2$
try {
pi.setInTheModel(false);
pluginBase.remove(pi);
- } catch (CoreException e) {
+ } catch (final CoreException e) {
e.printStackTrace();
}
}
diff --git a/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/mail/MailTemplate.java b/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/mail/MailTemplate.java
index 806568b..2002992 100644
--- a/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/mail/MailTemplate.java
+++ b/org.eclipse.riena.ui.templates/src/org/eclipse/riena/ui/templates/mail/MailTemplate.java
@@ -25,6 +25,7 @@ import org.eclipse.pde.ui.IFieldData;
import org.eclipse.riena.ui.templates.RienaTemplateSection;
+@SuppressWarnings("restriction")
public class MailTemplate extends RienaTemplateSection {
public static final String KEY_WORKBENCH_ADVISOR = "advisor"; //$NON-NLS-1$
@@ -405,7 +406,7 @@ public class MailTemplate extends RienaTemplateSection {
*/
@Override
public String[] getNewFiles() {
- return new String[] { "icons/", "product_lg.gif" }; //$NON-NLS-1$ //$NON-NLS-2$
+ return new String[] { "icons/", "product_lg.gif" }; //$NON-NLS-1$ //$NON-NLS-2$
}
/*
diff --git a/org.eclipse.riena.ui.wizard.cs/.checkstyle b/org.eclipse.riena.ui.wizard.cs/.checkstyle
index c439e1a..73b67d8 100644
--- a/org.eclipse.riena.ui.wizard.cs/.checkstyle
+++ b/org.eclipse.riena.ui.wizard.cs/.checkstyle
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<fileset-config file-format-version="1.2.0" simple-config="true" sync-formatter="false">
- <fileset name="all" enabled="true" check-config-name="Sun Checks" local="false">
+ <fileset name="all" enabled="true" check-config-name="riena" local="false">
<file-match-pattern match-pattern="." include-pattern="true"/>
</fileset>
<filter name="NonSrcDirs" enabled="true"/>
diff --git a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaApplicationWizard.java b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaApplicationWizard.java
index 0a11750..be62425 100644
--- a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaApplicationWizard.java
+++ b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaApplicationWizard.java
@@ -48,6 +48,7 @@ public class RienaApplicationWizard extends Wizard implements INewWizard {
} catch (final InvocationTargetException e) {
RienaWizardPlugin.error(e);
} catch (final InterruptedException e) {
+ e.printStackTrace();
}
return true;
}
diff --git a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardImages.java b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardImages.java
index 4196ae5..f9b0588 100644
--- a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardImages.java
+++ b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardImages.java
@@ -16,7 +16,7 @@ import org.eclipse.core.runtime.FileLocator;
import org.eclipse.core.runtime.Path;
import org.eclipse.jface.resource.ImageDescriptor;
-public class RienaWizardImages {
+public final class RienaWizardImages {
private final static String ICONS = "icons"; //$NON-NLS-1$
private final static String WIZBAN = "wizban"; //$NON-NLS-1$
@@ -32,4 +32,11 @@ public class RienaWizardImages {
final Path path = new Path(String.format("/%s/%s/%s", ICONS, prefix, name)); //$NON-NLS-1$
return FileLocator.find(RienaWizardPlugin.getDefault().getBundle(), path, null);
}
+
+ /**
+ *
+ */
+ private RienaWizardImages() {
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardMessages.java b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardMessages.java
index 418d55a..5e5dfc7 100644
--- a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardMessages.java
+++ b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/RienaWizardMessages.java
@@ -32,11 +32,11 @@ public class RienaWizardMessages extends NLS {
public static String GeneralPage_ProjectName;
public static String GeneralPage_PackageName;
-
+ //CHECKSTYLE:OFF
public static String GeneralPage_Validation_GeneralPage_ProjectsToBeCreated;
public static String GeneralPage_Validation_NoBasePluginId;
public static String GeneralPage_Validation_NoProjectName;
public static String GeneralPage_Validation_ProjectAlreadyExists;
public static String GenerateProjectOperation_Name;
-
+ //CHECKSTYLE:ON
}
diff --git a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorProperties.java b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorProperties.java
index b9a4065..77a2566 100644
--- a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorProperties.java
+++ b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorProperties.java
@@ -10,8 +10,15 @@
*******************************************************************************/
package org.eclipse.riena.ui.wizard.cs.internal.generate;
-public interface GeneratorProperties {
- public static final String SOURCE_FOLDER = "src"; //$NON-NLS-1$
- public static final String PACKAGE = "package"; //$NON-NLS-1$
- public static final String EXECUTION_ENVIRONMENT = "executionEnvironment"; //$NON-NLS-1$
+/**
+ *
+ */
+public class GeneratorProperties {
+ public final static String SOURCE_FOLDER = "src"; //$NON-NLS-1$
+ public final static String PACKAGE = "package"; //$NON-NLS-1$
+ public final static String EXECUTION_ENVIRONMENT = "executionEnvironment"; //$NON-NLS-1$
+
+ private GeneratorProperties() {
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorUtil.java b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorUtil.java
index 417c92a..beb08ab 100644
--- a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorUtil.java
+++ b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/generate/GeneratorUtil.java
@@ -32,4 +32,11 @@ public class GeneratorUtil {
}
}
}
+
+ /**
+ *
+ */
+ private GeneratorUtil() {
+ // TODO Auto-generated constructor stub
+ }
}
diff --git a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/pages/GeneralPageLayout.java b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/pages/GeneralPageLayout.java
index d55e1fb..dab8a23 100644
--- a/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/pages/GeneralPageLayout.java
+++ b/org.eclipse.riena.ui.wizard.cs/src/org/eclipse/riena/ui/wizard/cs/internal/pages/GeneralPageLayout.java
@@ -30,6 +30,7 @@ public abstract class GeneralPageLayout extends AbstractPage {
super(pageName);
}
+ @Override
public void createControl(final Composite parent) {
super.createControl(parent);