diff --git a/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF b/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF index bf7525dc33..5259803ad6 100644 --- a/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF +++ b/ui/org.eclipse.pde.ui.templates/META-INF/MANIFEST.MF @@ -2,7 +2,7 @@ Manifest-Version: 1.0 Bundle-ManifestVersion: 2 Bundle-Name: %bundleName Bundle-SymbolicName: org.eclipse.pde.ui.templates;singleton:=true -Bundle-Version: 3.9.0.qualifier +Bundle-Version: 3.9.100.qualifier Bundle-Vendor: %bundleVendor Bundle-RequiredExecutionEnvironment: JavaSE-21 Export-Package: org.eclipse.pde.internal.ui.templates;x-internal:=true, diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java index d2d77be617..e408125bcf 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateSection.java @@ -68,16 +68,21 @@ public URL getTemplateLocation() { private String[] getDirectoryCandidates() { double version = getTargetVersion(); ArrayList result = new ArrayList<>(); - if (version >= 3.5) + if (version >= 3.5) { result.add("templates_3.5" + "/" + getSectionId() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (version >= 3.4) + } + if (version >= 3.4) { result.add("templates_3.4" + "/" + getSectionId() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (version >= 3.3) + } + if (version >= 3.3) { result.add("templates_3.3" + "/" + getSectionId() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (version >= 3.2) + } + if (version >= 3.2) { result.add("templates_3.2" + "/" + getSectionId() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - if (version >= 3.1) + } + if (version >= 3.1) { result.add("templates_3.1" + "/" + getSectionId() + "/"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ + } return result.toArray(new String[result.size()]); } @@ -91,11 +96,13 @@ protected String getFormattedPackageName(String id) { for (int i = 0; i < id.length(); i++) { char ch = id.charAt(i); if (buffer.length() == 0) { - if (Character.isJavaIdentifierStart(ch)) + if (Character.isJavaIdentifierStart(ch)) { buffer.append(Character.toLowerCase(ch)); + } } else { - if (Character.isJavaIdentifierPart(ch) || ch == '.') + if (Character.isJavaIdentifierPart(ch) || ch == '.') { buffer.append(ch); + } } } return buffer.toString().toLowerCase(Locale.ENGLISH); diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/AbstractE4NewPluginTemplateWizard.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/AbstractE4NewPluginTemplateWizard.java index 147ab0f8e6..c1c82d7661 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/AbstractE4NewPluginTemplateWizard.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/AbstractE4NewPluginTemplateWizard.java @@ -70,22 +70,25 @@ public boolean performFinish(IProject project, IPluginModelBase model, IProgress String runtimeVersion = null; for (IPluginImport ii : pb.getImports()) { - if (ii.getId().equals(ORG_ECLIPSE_UI)) + if (ii.getId().equals(ORG_ECLIPSE_UI)) { ui = ii; + } if (ii.getId().equals(ORG_ECLIPSE_CORE_RUNTIME)) { // This plugin appears twice : with and without version (due to ancestor) - if (ii.getVersion() == null) + if (ii.getVersion() == null) { runtime = ii; - else + } else { runtimeVersion = ii.getVersion(); + } } } // Remove these two bad imports... try { - if (ui != null) + if (ui != null) { pb.remove(ui); + } if (runtime != null) { // Remove the org.eclipse.core.runtime without any version pb.remove(runtime); @@ -124,8 +127,9 @@ private void openEditorForApplicationModel(IProject project) throws PartInitExce final FileEditorInput input = new FileEditorInput(file); final IWorkbenchWindow window = PlatformUI.getWorkbench().getActiveWorkbenchWindow(); final IWorkbenchPage page = window.getActivePage(); - if (page != null) + if (page != null) { page.openEditor(input, MODEL_EDITOR_ID); + } } } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ApplicationTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ApplicationTemplate.java index f2cb5be117..e673c6b499 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ApplicationTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ApplicationTemplate.java @@ -143,16 +143,18 @@ private void createProductExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override protected boolean isOkToCreateFolder(File sourceFolder) { // We copy the files in 'org.eclipse.pde.ui.templates/templates_3.5/E4Application/*/handlers' or 'parts' if content required String fname = sourceFolder.getName(); - if (fname.endsWith("handlers") || fname.endsWith("parts")) //$NON-NLS-1$//$NON-NLS-2$ + if (fname.endsWith("handlers") || fname.endsWith("parts")) { //$NON-NLS-1$//$NON-NLS-2$ return getBooleanOption(KEY_CREATE_SAMPLE_CONTENT); + } return super.isOkToCreateFolder(sourceFolder); } @@ -162,8 +164,9 @@ protected boolean isOkToCreateFile(File sourceFile) { // If file is the lifeCycleClassname (with a $ at the end) we keep it only if life cycle must be created. String fname = sourceFile.getName(); - if (fname.equals(TEMPLATE_LIFECYCLE_FILENAME)) + if (fname.equals(TEMPLATE_LIFECYCLE_FILENAME)) { return getBooleanOption(KEY_CREATE_LIFE_CYCLE); + } // There are 2 application models : // the bin/Application.e4xmi containing the empty model diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4HandlerTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4HandlerTemplate.java index 28b56f5f82..b019d4a5e3 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4HandlerTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4HandlerTemplate.java @@ -122,8 +122,9 @@ private void createE4ModelExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ToolbarContributionTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ToolbarContributionTemplate.java index afe8ed58c7..8217d58643 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ToolbarContributionTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ToolbarContributionTemplate.java @@ -123,8 +123,9 @@ private void createE4ModelExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ViewTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ViewTemplate.java index 6d57c4b7b5..c869aecc90 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ViewTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/e4/E4ViewTemplate.java @@ -124,8 +124,9 @@ private void createE4ModelExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BrowserViewTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BrowserViewTemplate.java index 6135a5768a..ecd2fc03d4 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BrowserViewTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BrowserViewTemplate.java @@ -142,8 +142,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { viewElement.setAttribute("category", cid); //$NON-NLS-1$ viewElement.setAttribute("inject", "true"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(viewElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } if (addToPerspective.isSelected()) { IPluginExtension perspectiveExtension = createExtension("org.eclipse.ui.perspectiveExtensions", true); //$NON-NLS-1$ @@ -161,8 +162,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { perspectiveElement.add(view); perspectiveExtension.add(perspectiveElement); - if (!perspectiveExtension.isInTheModel()) + if (!perspectiveExtension.isInTheModel()) { plugin.add(perspectiveExtension); + } } } @@ -174,8 +176,9 @@ private void createCategory(IPluginExtension extension, String id) throws CoreEx IPluginAttribute att = element.getAttribute("id"); //$NON-NLS-1$ if (att != null) { String cid = att.getValue(); - if (cid != null && cid.equals(id)) + if (cid != null && cid.equals(id)) { return; + } } } } @@ -194,8 +197,9 @@ public String[] getNewFiles() { @Override public IPluginReference[] getDependencies(String schemaVersion) { ArrayList result = new ArrayList<>(); - if (schemaVersion != null) + if (schemaVersion != null) { result.add(new PluginReference("org.eclipse.core.runtime")); //$NON-NLS-1$ + } result.add(new PluginReference("org.eclipse.ui")); //$NON-NLS-1$ return result.toArray(new IPluginReference[result.size()]); } @@ -203,15 +207,17 @@ public IPluginReference[] getDependencies(String schemaVersion) { @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".views"; //$NON-NLS-1$ + } return "views"; //$NON-NLS-1$ } @Override public Object getValue(String name) { - if (name.equals("useEnablement")) //$NON-NLS-1$ + if (name.equals("useEnablement")) { //$NON-NLS-1$ return Boolean.valueOf(getTargetVersion() >= 3.3); + } return super.getValue(name); } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BuilderTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BuilderTemplate.java index 68e64de7f0..4f079ee6ed 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BuilderTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/BuilderTemplate.java @@ -141,8 +141,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { + "." + getStringOption(KEY_BUILDER_CLASS_NAME)); //$NON-NLS-1$ builder.add(run); - if (!extension1.isInTheModel()) + if (!extension1.isInTheModel()) { plugin.add(extension1); + } // Nature IPluginExtension extension2 = createExtension("org.eclipse.core.resources.natures", true); //$NON-NLS-1$ @@ -165,8 +166,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { + "." + getStringOption(KEY_BUILDER_ID)); //$NON-NLS-1$ extension2.add(builder2); - if (!extension2.isInTheModel()) + if (!extension2.isInTheModel()) { plugin.add(extension2); + } // Popup Action if (actionOption.isSelected()) { @@ -190,8 +192,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { command.setAttribute("name", PDETemplateMessages.BuilderTemplate_commandName + getStringOption(KEY_NATURE_NAME)); //$NON-NLS-1$ extension3.add(command); - if (!extension3.isInTheModel()) + if (!extension3.isInTheModel()) { plugin.add(extension3); + } IPluginExtension extension4 = createExtension("org.eclipse.ui.menus", true); //$NON-NLS-1$ IPluginElement menuContribution = factory.createElement(extension4); @@ -282,8 +285,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { + "." + getStringOption(KEY_NATURE_ID)); //$NON-NLS-1$ not.add(test2); - if (!extension4.isInTheModel()) + if (!extension4.isInTheModel()) { plugin.add(extension4); + } } // Marker @@ -302,18 +306,21 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { persistent.setAttribute("value", "true"); //$NON-NLS-1$ //$NON-NLS-2$ extension8.add(persistent); - if (!extension8.isInTheModel()) + if (!extension8.isInTheModel()) { plugin.add(extension8); + } } @Override public IPluginReference[] getDependencies(String schemaVersion) { ArrayList result = new ArrayList<>(); result.add(new PluginReference("org.eclipse.core.resources")); //$NON-NLS-1$ - if (schemaVersion != null) + if (schemaVersion != null) { result.add(new PluginReference("org.eclipse.core.runtime")); //$NON-NLS-1$ - if (actionOption.isSelected()) + } + if (actionOption.isSelected()) { result.add(new PluginReference("org.eclipse.ui")); //$NON-NLS-1$ + } return result.toArray(new IPluginReference[result.size()]); } @@ -321,8 +328,9 @@ public IPluginReference[] getDependencies(String schemaVersion) { @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".builder"; //$NON-NLS-1$ + } return "builder"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java index 29140e064a..d7ff00a5cb 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java @@ -91,14 +91,16 @@ private void createAddToPerspective() throws CoreException { perspectiveElement.add(view); perspectiveExtension.add(perspectiveElement); - if (!perspectiveExtension.isInTheModel()) + if (!perspectiveExtension.isInTheModel()) { plugin.add(perspectiveExtension); + } } private void createViewer() throws CoreException { IPluginExtension viewerExtension = createExtension("org.eclipse.ui.navigator.viewer", true); //$NON-NLS-1$ - if (!viewerExtension.isInTheModel()) + if (!viewerExtension.isInTheModel()) { plugin.add(viewerExtension); + } createActionBinding(viewerExtension); createContentBinding(viewerExtension); @@ -151,8 +153,9 @@ private void createView() throws CoreException { viewElement.setAttribute("class", "org.eclipse.ui.navigator.CommonNavigator"); //$NON-NLS-1$ //$NON-NLS-2$ viewExtension.add(viewElement); - if (!viewExtension.isInTheModel()) + if (!viewExtension.isInTheModel()) { plugin.add(viewExtension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/DecoratorTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/DecoratorTemplate.java index 74b7940e41..177f7406e6 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/DecoratorTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/DecoratorTemplate.java @@ -227,10 +227,11 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { projectObjectElement.setName("objectClass"); //$NON-NLS-1$ projectObjectElement.setAttribute("name", "org.eclipse.core.resources.IProject"); //$NON-NLS-1$ //$NON-NLS-2$ - if (readOnlyOption.isSelected()) + if (readOnlyOption.isSelected()) { orElement.add(folderObjectElement); - else if (projectOption.isSelected()) + } else if (projectOption.isSelected()) { orElement.add(projectObjectElement); + } orElement.add(fileObjectElement); andElement.add(resourceObjectElement); andElement.add(orElement); @@ -238,8 +239,9 @@ else if (projectOption.isSelected()) decoratorElement.add(enablementElement); extension.add(decoratorElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override @@ -252,8 +254,9 @@ protected String getFormattedPackageName(String id) { // Package name addition to create a location for containing // any classes required by the decorator. String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".decorators"; //$NON-NLS-1$ + } return "decorators"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/EditorTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/EditorTemplate.java index c4712e5b56..2bccbedad4 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/EditorTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/EditorTemplate.java @@ -142,15 +142,17 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { editorElement.setAttribute("contributorClass", //$NON-NLS-1$ "org.eclipse.ui.texteditor.BasicTextEditorActionContributor"); //$NON-NLS-1$ extension.add(editorElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".editors"; //$NON-NLS-1$ + } return "editors"; //$NON-NLS-1$ } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelloWorldCmdTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelloWorldCmdTemplate.java index d31abf2b56..279d638117 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelloWorldCmdTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelloWorldCmdTemplate.java @@ -204,8 +204,9 @@ public String[] getNewFiles() { @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".handlers"; //$NON-NLS-1$ + } return "handlers"; //$NON-NLS-1$ } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java index fbec02a53e..53df42f7fa 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/HelpTemplate.java @@ -169,8 +169,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { IPluginElement tocElement = factory.createElement(extension); tocElement.setName("toc"); //$NON-NLS-1$ tocElement.setAttribute("file", "toc.xml"); //$NON-NLS-1$ //$NON-NLS-2$ - if (primaryOption.isSelected()) + if (primaryOption.isSelected()) { tocElement.setAttribute("primary", "true"); //$NON-NLS-1$ //$NON-NLS-2$ + } extension.add(tocElement); if (genTestOption.isSelected() && genTestOption.isEnabled()) { @@ -186,8 +187,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { addNonPrimaryTopic(samplesOption, "tocsamples.xml", extension); //$NON-NLS-1$ addNonPrimaryTopic(tasksOption, "toctasks.xml", extension); //$NON-NLS-1$ - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void addNonPrimaryTopic(BooleanOption option, String file, IPluginExtension extension) throws CoreException { diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ImportWizardTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ImportWizardTemplate.java index d582d66454..06b661bf8f 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ImportWizardTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ImportWizardTemplate.java @@ -156,8 +156,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { wizardElement.add(descriptionElement); extension.add(categoryElement); extension.add(wizardElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override @@ -170,8 +171,9 @@ protected String getFormattedPackageName(String id) { // Package name addition to create a location for containing // any classes required by the decorator. String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".importWizards"; //$NON-NLS-1$ + } return "importWizards"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/MultiPageEditorTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/MultiPageEditorTemplate.java index d1cf9702d0..2410761aea 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/MultiPageEditorTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/MultiPageEditorTemplate.java @@ -147,15 +147,17 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { editorElement.setAttribute("class", editorClassName); //$NON-NLS-1$ editorElement.setAttribute("contributorClass", contributorClassName); //$NON-NLS-1$ extension.add(editorElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".editors"; //$NON-NLS-1$ + } return "editors"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/NewWizardTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/NewWizardTemplate.java index 9e47ab5ba8..fcdb193c67 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/NewWizardTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/NewWizardTemplate.java @@ -131,8 +131,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { viewElement.setAttribute("class", fullClassName); //$NON-NLS-1$ viewElement.setAttribute("category", cid); //$NON-NLS-1$ extension.add(viewElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createCategory(IPluginExtension extension, String id) throws CoreException { @@ -143,8 +144,9 @@ private void createCategory(IPluginExtension extension, String id) throws CoreEx IPluginAttribute att = element.getAttribute("id"); //$NON-NLS-1$ if (att != null) { String cid = att.getValue(); - if (cid != null && cid.equals(id)) + if (cid != null && cid.equals(id)) { return; + } } } } @@ -163,8 +165,9 @@ public String[] getNewFiles() { @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".wizards"; //$NON-NLS-1$ + } return "wizards"; //$NON-NLS-1$ } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PerspectiveTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PerspectiveTemplate.java index 2960ca3537..3f2d564ca7 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PerspectiveTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PerspectiveTemplate.java @@ -137,8 +137,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { perspectiveElement.setAttribute("icon", "icons/releng_gears.gif"); //$NON-NLS-1$ //$NON-NLS-2$ $NON-NLS-2$ extension.add(perspectiveElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override @@ -151,8 +152,9 @@ protected String getFormattedPackageName(String id) { // Package name addition to create a location for containing // any classes required by the decorator. String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".perspectives"; //$NON-NLS-1$ + } return "perspectives"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PreferencePageTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PreferencePageTemplate.java index 42c82373ff..328ac19639 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PreferencePageTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PreferencePageTemplate.java @@ -120,23 +120,26 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { pageElement.setAttribute("name", getStringOption(KEY_PAGE_NAME)); //$NON-NLS-1$ pageElement.setAttribute("class", fullClassName); //$NON-NLS-1$ extension.add(pageElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } IPluginExtension extension2 = createExtension("org.eclipse.core.runtime.preferences", true); //$NON-NLS-1$ IPluginElement prefElement = factory.createElement(extension); prefElement.setName("initializer"); //$NON-NLS-1$ prefElement.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + ".PreferenceInitializer"); //$NON-NLS-1$ //$NON-NLS-2$ extension2.add(prefElement); - if (!extension2.isInTheModel()) + if (!extension2.isInTheModel()) { plugin.add(extension2); + } } @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".preferences"; //$NON-NLS-1$ + } return "preferences"; //$NON-NLS-1$ } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PropertyPageTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PropertyPageTemplate.java index 6c77c3c261..543c538a77 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PropertyPageTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/PropertyPageTemplate.java @@ -128,8 +128,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { pageElement.setAttribute("nameFilter", getStringOption(KEY_NAME_FILTER)); //$NON-NLS-1$ extension.add(pageElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } /** @@ -144,8 +145,9 @@ public String getUsedExtensionPoint() { public IPluginReference[] getDependencies(String schemaVersion) { ArrayList result = new ArrayList<>(); result.add(new PluginReference("org.eclipse.core.resources")); //$NON-NLS-1$ - if (schemaVersion != null) + if (schemaVersion != null) { result.add(new PluginReference("org.eclipse.core.runtime")); //$NON-NLS-1$ + } result.add(new PluginReference("org.eclipse.ui")); //$NON-NLS-1$ return result.toArray(new IPluginReference[result.size()]); @@ -154,8 +156,9 @@ public IPluginReference[] getDependencies(String schemaVersion) { @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".properties"; //$NON-NLS-1$ + } return "properties"; //$NON-NLS-1$ } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/UniversalWelcomeTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/UniversalWelcomeTemplate.java index 2cd324f1bc..7ab40d5726 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/UniversalWelcomeTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/UniversalWelcomeTemplate.java @@ -113,8 +113,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { + "/sample.xml"); //$NON-NLS-1$ extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ViewTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ViewTemplate.java index e58c630013..9883cd995b 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ViewTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/ide/ViewTemplate.java @@ -157,8 +157,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { viewElement.setAttribute("category", cid); //$NON-NLS-1$ viewElement.setAttribute("inject", "true"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(viewElement); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } if (addToPerspective.isSelected()) { IPluginExtension perspectiveExtension = createExtension("org.eclipse.ui.perspectiveExtensions", true); //$NON-NLS-1$ @@ -177,8 +178,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { perspectiveElement.add(view); perspectiveExtension.add(perspectiveElement); - if (!perspectiveExtension.isInTheModel()) + if (!perspectiveExtension.isInTheModel()) { plugin.add(perspectiveExtension); + } } if (contextHelp.isSelected()) { @@ -188,8 +190,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { contextsElement.setName("contexts"); //$NON-NLS-1$ contextsElement.setAttribute("file", "contexts.xml"); //$NON-NLS-1$ //$NON-NLS-2$ contextExtension.add(contextsElement); - if (!contextExtension.isInTheModel()) + if (!contextExtension.isInTheModel()) { plugin.add(contextExtension); + } } } @@ -201,8 +204,9 @@ private void createCategory(IPluginExtension extension, String id) throws CoreEx IPluginAttribute att = element.getAttribute("id"); //$NON-NLS-1$ if (att != null) { String cid = att.getValue(); - if (cid != null && cid.equals(id)) + if (cid != null && cid.equals(id)) { return; + } } } } @@ -215,16 +219,18 @@ private void createCategory(IPluginExtension extension, String id) throws CoreEx @Override public String[] getNewFiles() { - if (contextHelp.isSelected()) + if (contextHelp.isSelected()) { return new String[] {"icons/", "contexts.xml"}; //$NON-NLS-1$ //$NON-NLS-2$ + } return new String[] {"icons/"}; //$NON-NLS-1$ } @Override public IPluginReference[] getDependencies(String schemaVersion) { ArrayList result = new ArrayList<>(); - if (schemaVersion != null) + if (schemaVersion != null) { result.add(new PluginReference("org.eclipse.core.runtime")); //$NON-NLS-1$ + } result.add(new PluginReference("org.eclipse.ui")); //$NON-NLS-1$ return result.toArray(new IPluginReference[result.size()]); } @@ -232,15 +238,17 @@ public IPluginReference[] getDependencies(String schemaVersion) { @Override protected String getFormattedPackageName(String id) { String packageName = super.getFormattedPackageName(id); - if (packageName.length() != 0) + if (packageName.length() != 0) { return packageName + ".views"; //$NON-NLS-1$ + } return "views"; //$NON-NLS-1$ } @Override public Object getValue(String name) { - if (name.equals("useEnablement")) //$NON-NLS-1$ + if (name.equals("useEnablement")) { //$NON-NLS-1$ return Boolean.valueOf(getTargetVersion() >= 3.3); + } return super.getValue(name); } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloNonUIRCPTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloNonUIRCPTemplate.java index 4e33f4bfa1..5df42c4479 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloNonUIRCPTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloNonUIRCPTemplate.java @@ -95,8 +95,9 @@ private void createApplicationExtension() throws CoreException { run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_APPLICATION_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$ element.add(run); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloRCPTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloRCPTemplate.java index 628b17434c..06357baea6 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloRCPTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/HelloRCPTemplate.java @@ -80,8 +80,9 @@ public String getSectionId() { protected void updateModel(IProgressMonitor monitor) throws CoreException { createApplicationExtension(); createPerspectiveExtension(); - if (getBooleanOption(KEY_PRODUCT_BRANDING)) + if (getBooleanOption(KEY_PRODUCT_BRANDING)) { createProductExtension(); + } } private void createApplicationExtension() throws CoreException { @@ -99,8 +100,9 @@ private void createApplicationExtension() throws CoreException { run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_APPLICATION_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$ element.add(run); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createPerspectiveExtension() throws CoreException { @@ -114,8 +116,9 @@ private void createPerspectiveExtension() throws CoreException { element.setAttribute("id", plugin.getId() + ".perspective"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createProductExtension() throws CoreException { @@ -139,8 +142,9 @@ private void createProductExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override @@ -165,8 +169,9 @@ public IPluginReference[] getDependencies(String schemaVersion) { @Override public String[] getNewFiles() { - if (copyBrandingDirectory()) + if (copyBrandingDirectory()) { return new String[] {"icons/", "splash.bmp"}; //$NON-NLS-1$ //$NON-NLS-2$ + } return super.getNewFiles(); } } diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/IntroTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/IntroTemplate.java index 717e1ebd1d..a645f326e3 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/IntroTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/IntroTemplate.java @@ -118,8 +118,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + APPLICATION_CLASS); //$NON-NLS-1$ //$NON-NLS-2$ element.add(run); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } // org.eclipse.ui.perspectives IPluginExtension perspectivesExtension = createExtension("org.eclipse.ui.perspectives", true); //$NON-NLS-1$ @@ -130,8 +131,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { perspectiveElement.setAttribute("id", plugin.getId() + ".perspective"); //$NON-NLS-1$ //$NON-NLS-2$ perspectivesExtension.add(perspectiveElement); - if (!perspectivesExtension.isInTheModel()) + if (!perspectivesExtension.isInTheModel()) { plugin.add(perspectivesExtension); + } createProductExtension(); @@ -153,8 +155,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { + '.' + VALUE_PRODUCT_ID); extension2.add(introProductBindingElement); - if (!extension2.isInTheModel()) + if (!extension2.isInTheModel()) { plugin.add(extension2); + } // org.eclipse.ui.intro.config IPluginExtension extension3 = createExtension("org.eclipse.ui.intro.config", true); //$NON-NLS-1$ @@ -171,16 +174,18 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { IPluginElement implementationElement = factory.createElement(presentationElement); implementationElement.setName("implementation"); //$NON-NLS-1$ implementationElement.setAttribute("os", "win32,linux,macosx"); //$NON-NLS-1$ //$NON-NLS-2$ - if (getTargetVersion() == 3.0) + if (getTargetVersion() == 3.0) { implementationElement.setAttribute("style", "content/shared.css"); //$NON-NLS-1$//$NON-NLS-2$ + } implementationElement.setAttribute("kind", "html"); //$NON-NLS-1$ //$NON-NLS-2$ presentationElement.add(implementationElement); configurationElement.add(presentationElement); extension3.add(configurationElement); - if (!extension3.isInTheModel()) + if (!extension3.isInTheModel()) { plugin.add(extension3); + } // org.eclipse.ui.intro.configExtension if (getValue(KEY_GENERATE_DYNAMIC_CONTENT).toString().equals(DYNAMIC_SELECTED)) { @@ -192,8 +197,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { configExtensionElement.setAttribute("content", "ext.xml"); //$NON-NLS-1$ //$NON-NLS-2$ extension4.add(configExtensionElement); - if (!extension4.isInTheModel()) + if (!extension4.isInTheModel()) { plugin.add(extension4); + } } } @@ -219,8 +225,9 @@ private void createProductExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/MailTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/MailTemplate.java index ff76f628ad..bc16f702d8 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/MailTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/MailTemplate.java @@ -103,8 +103,9 @@ private void createApplicationExtension() throws CoreException { run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_APPLICATION_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$ element.add(run); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createPerspectiveExtension() throws CoreException { @@ -118,8 +119,9 @@ private void createPerspectiveExtension() throws CoreException { element.setAttribute("id", plugin.getId() + ".perspective"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createViewExtension() throws CoreException { @@ -145,8 +147,9 @@ private void createViewExtension() throws CoreException { view.setAttribute("id", id + ".navigationView"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(view); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createCommandExtension(boolean generateKeyBindings) throws CoreException { @@ -206,8 +209,9 @@ private void createCommandExtension(boolean generateKeyBindings) throws CoreExce extension.add(element); } - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createBindingsExtension() throws CoreException { @@ -236,8 +240,9 @@ private void createBindingsExtension() throws CoreException { element.setAttribute("schemeId", "org.eclipse.ui.defaultAcceleratorConfiguration"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createProductExtension() throws CoreException { diff --git a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/ViewRCPTemplate.java b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/ViewRCPTemplate.java index 9b721625f8..9bab863362 100644 --- a/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/ViewRCPTemplate.java +++ b/ui/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/rcp/ViewRCPTemplate.java @@ -89,8 +89,9 @@ protected void updateModel(IProgressMonitor monitor) throws CoreException { createPerspectiveViewExtension(); createMenuExtension(); - if (getBooleanOption(KEY_PRODUCT_BRANDING)) + if (getBooleanOption(KEY_PRODUCT_BRANDING)) { createProductExtension(); + } IBundle bundle = ((IBundlePluginModelBase) model).getBundleModel().getBundle(); bundle.setHeader(Constants.IMPORT_PACKAGE, "jakarta.inject;version=\"[2.0.0,3.0.0)\""); //$NON-NLS-1$ @@ -111,8 +112,9 @@ private void createApplicationExtension() throws CoreException { run.setAttribute("class", getStringOption(KEY_PACKAGE_NAME) + "." + getStringOption(KEY_APPLICATION_CLASS)); //$NON-NLS-1$ //$NON-NLS-2$ element.add(run); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createPerspectiveExtension() throws CoreException { @@ -126,8 +128,9 @@ private void createPerspectiveExtension() throws CoreException { element.setAttribute("id", plugin.getId() + ".perspective"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createViewExtension() throws CoreException { @@ -143,8 +146,9 @@ private void createViewExtension() throws CoreException { view.setAttribute("inject", "true"); //$NON-NLS-1$ //$NON-NLS-2$ extension.add(view); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createPerspectiveViewExtension() throws CoreException { @@ -166,8 +170,9 @@ private void createPerspectiveViewExtension() throws CoreException { view.setAttribute("relative", "org.eclipse.ui.editorss"); //$NON-NLS-1$ //$NON-NLS-2$ perspectiveExtension.add(view); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createMenuExtension() throws CoreException { @@ -189,8 +194,9 @@ private void createMenuExtension() throws CoreException { command.setAttribute("label", "Exit"); //$NON-NLS-1$ //$NON-NLS-2$ menu.add(command); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } private void createProductExtension() throws CoreException { @@ -214,8 +220,9 @@ private void createProductExtension() throws CoreException { extension.add(element); - if (!extension.isInTheModel()) + if (!extension.isInTheModel()) { plugin.add(extension); + } } @Override @@ -240,8 +247,9 @@ public IPluginReference[] getDependencies(String schemaVersion) { @Override public String[] getNewFiles() { - if (copyBrandingDirectory()) + if (copyBrandingDirectory()) { return new String[] {"icons/", "splash.bmp"}; //$NON-NLS-1$ //$NON-NLS-2$ + } return super.getNewFiles(); } }