Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 106477 Details for
Bug 239076
Add an Extension Wizard for Common Navigator
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
Patch for the bug
CommonNavigatorExtPatch.txt (text/plain), 10.94 KB, created by
Prakash G.R.
on 2008-07-03 13:24:41 EDT
(
hide
)
Description:
Patch for the bug
Filename:
MIME Type:
Creator:
Prakash G.R.
Created:
2008-07-03 13:24:41 EDT
Size:
10.94 KB
patch
obsolete
>Index: src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java,v >retrieving revision 1.6 >diff -u -r1.6 PDETemplateMessages.java >--- src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java 27 Dec 2007 20:01:36 -0000 1.6 >+++ src/org/eclipse/pde/internal/ui/templates/PDETemplateMessages.java 3 Jul 2008 16:53:59 -0000 >@@ -300,4 +300,9 @@ > public static String OSGiSimpleLogServiceTemplate_startLogMessage; > public static String OSGiSimpleLogServiceTemplate_stopLogMessage; > >+ //Common Navigator Navigator >+ public static String CommonNavigatorTemplate_viewId; >+ public static String CommonNavigatorTemplate_viewName; >+ public static String CommonNavigatorTemplate_addToPerspective; >+ > } >\ No newline at end of file >Index: src/org/eclipse/pde/internal/ui/templates/pderesources.properties >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui.templates/src/org/eclipse/pde/internal/ui/templates/pderesources.properties,v >retrieving revision 1.6 >diff -u -r1.6 pderesources.properties >--- src/org/eclipse/pde/internal/ui/templates/pderesources.properties 21 Jun 2007 14:38:43 -0000 1.6 >+++ src/org/eclipse/pde/internal/ui/templates/pderesources.properties 3 Jul 2008 16:53:59 -0000 >@@ -266,3 +266,8 @@ > HelloWorldCmdTemplate_sampleAction_mnemonic = S > HelloWorldCmdTemplate_sampleAction_tooltip = Say hello world > >+# Common Navigator Emplate >+CommonNavigatorTemplate_viewId = View Id: >+CommonNavigatorTemplate_viewName = View Name: >+CommonNavigatorTemplate_addToPerspective = Add to Resource Perspective >+ >Index: plugin.xml >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.pde.ui.templates/plugin.xml,v >retrieving revision 1.5 >diff -u -r1.5 plugin.xml >--- plugin.xml 25 Apr 2007 19:36:17 -0000 1.5 >+++ plugin.xml 3 Jul 2008 16:53:59 -0000 >@@ -38,6 +38,16 @@ > </description> > </wizard> > <wizard >+ category="templates" >+ icon="$nl$/icons/etool16/newex_wiz.gif" >+ id="org.eclipse.pde.ui.newExtension.commonNavigator" >+ name="%newExtension.templates.commonNavigator.name" >+ template="org.eclipse.pde.ui.templates.commonNavigator"> >+ <description> >+ %newExtension.templates.commonNavigator.desc >+ </description> >+ </wizard> >+ <wizard > name="%newExtension.templates.multiPageEditor.name" > template="org.eclipse.pde.ui.templates.multiPageEditor" > icon="$nl$/icons/etool16/newex_wiz.gif" >@@ -213,6 +223,12 @@ > id="org.eclipse.pde.ui.templates.popup"> > </template> > <template >+ class="org.eclipse.pde.internal.ui.templates.ide.CommonNavigatorTemplate" >+ contributingId="org.eclipse.ui.navigator.viewer" >+ id="org.eclipse.pde.ui.templates.commonNavigator" >+ name="%template.commonNavigator.name"> >+ </template> >+ <template > contributingId="org.eclipse.ui.views" > name="%template.view.name" > class="org.eclipse.pde.internal.ui.templates.ide.ViewTemplate" >Index: src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java >=================================================================== >RCS file: src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java >diff -N src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java >--- /dev/null 1 Jan 1970 00:00:00 -0000 >+++ src/org/eclipse/pde/internal/ui/templates/ide/CommonNavigatorTemplate.java 1 Jan 1970 00:00:00 -0000 >@@ -0,0 +1,187 @@ >+/******************************************************************************* >+ * Copyright (c) 2008 Cypal Solutions. >+ * All rights reserved. This program and the accompanying materials >+ * are made available under the terms of the Eclipse Public License v1.0 >+ * which accompanies this distribution, and is available at >+ * http://www.eclipse.org/legal/epl-v10.html >+ * >+ * Contributors: >+ * Cypal Solutions - initial implementation >+ *******************************************************************************/ >+ >+package org.eclipse.pde.internal.ui.templates.ide; >+ >+import java.util.ArrayList; >+import org.eclipse.core.runtime.CoreException; >+import org.eclipse.core.runtime.IProgressMonitor; >+import org.eclipse.jface.wizard.Wizard; >+import org.eclipse.jface.wizard.WizardPage; >+import org.eclipse.pde.core.plugin.*; >+import org.eclipse.pde.internal.ui.templates.PDETemplateMessages; >+import org.eclipse.pde.internal.ui.templates.PDETemplateSection; >+import org.eclipse.pde.ui.templates.BooleanOption; >+import org.eclipse.pde.ui.templates.PluginReference; >+ >+/** >+ * >+ * @author Prakash G.R. (prakash@cypal.in) >+ * >+ */ >+public class CommonNavigatorTemplate extends PDETemplateSection { >+ >+ public static final String KEY_VIEW_ID = "viewId"; //$NON-NLS-1$ >+ public static final String KEY_VIEW_NAME = "viewName"; //$NON-NLS-1$ >+ public static final String KEY_ADD_TO_PERSPECTIVE = "addToPerspective"; //$NON-NLS-1$ >+ >+ private BooleanOption addToPerspective; >+ private IPluginBase plugin; >+ private IPluginModelFactory factory; >+ private String viewId; >+ >+ public CommonNavigatorTemplate() { >+ setPageCount(1); >+ createOptions(); >+ } >+ >+ private void createOptions() { >+ >+ addOption(KEY_VIEW_ID, PDETemplateMessages.CommonNavigatorTemplate_viewId, "com.example.test", 0); >+ addOption(KEY_VIEW_NAME, PDETemplateMessages.CommonNavigatorTemplate_viewName, "My Common Navigator", 0); >+ addToPerspective = (BooleanOption) addOption(KEY_ADD_TO_PERSPECTIVE, PDETemplateMessages.CommonNavigatorTemplate_addToPerspective, true, 0); >+ } >+ >+ public String getSectionId() { >+ return "commonNavigator"; //$NON-NLS-1$ >+ } >+ >+ protected void updateModel(IProgressMonitor monitor) throws CoreException { >+ >+ plugin = model.getPluginBase(); >+ factory = model.getPluginFactory(); >+ viewId = getStringOption(KEY_VIEW_ID); >+ >+ createView(); >+ >+ createViewer(); >+ >+ if (addToPerspective.isSelected()) { >+ createAddToPerspective(); >+ } >+ } >+ >+ private void createAddToPerspective() throws CoreException { >+ >+ IPluginExtension perspectiveExtension = createExtension("org.eclipse.ui.perspectiveExtensions", true); //$NON-NLS-1$ >+ >+ IPluginElement perspectiveElement = factory.createElement(perspectiveExtension); >+ perspectiveElement.setName("perspectiveExtension"); //$NON-NLS-1$ >+ perspectiveElement.setAttribute("targetID", //$NON-NLS-1$ >+ "org.eclipse.ui.resourcePerspective"); //$NON-NLS-1$ >+ >+ IPluginElement view = factory.createElement(perspectiveElement); >+ view.setName("view"); //$NON-NLS-1$ >+ view.setAttribute("id", viewId); //$NON-NLS-1$ >+ view.setAttribute("relative", "org.eclipse.ui.navigator.ProjectExplorer"); //$NON-NLS-1$ //$NON-NLS-2$ >+ view.setAttribute("relationship", "stack"); //$NON-NLS-1$ //$NON-NLS-2$ >+ view.setAttribute("ratio", "0.5"); //$NON-NLS-1$ //$NON-NLS-2$ >+ perspectiveElement.add(view); >+ >+ perspectiveExtension.add(perspectiveElement); >+ 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()) >+ plugin.add(viewerExtension); >+ >+ createActionBinding(viewerExtension); >+ >+ createContentBinding(viewerExtension); >+ >+ } >+ >+ private void createContentBinding(IPluginExtension viewerExtension) throws CoreException { >+ >+ IPluginElement viewerContentBindingElement = factory.createElement(viewerExtension); >+ viewerContentBindingElement.setName("viewerContentBinding"); >+ viewerContentBindingElement.setAttribute("viewerId", viewId); >+ >+ IPluginElement includesElement = factory.createElement(viewerContentBindingElement); >+ includesElement.setName("includes"); >+ createChild(includesElement, "contentExtension", "pattern", "org.eclipse.ui.navigator.resourceContent"); >+ createChild(includesElement, "contentExtension", "pattern", "org.eclipse.ui.navigator.resources.filters.*"); >+ createChild(includesElement, "contentExtension", "pattern", "org.eclipse.ui.navigator.resources.linkHelper"); >+ createChild(includesElement, "contentExtension", "pattern", "org.eclipse.ui.navigator.resources.workingSets"); >+ >+ viewerContentBindingElement.add(includesElement); >+ viewerExtension.add(viewerContentBindingElement); >+ >+ } >+ >+ private void createActionBinding(IPluginExtension viewerExtension) throws CoreException { >+ >+ IPluginElement viewerActionBindingElement = factory.createElement(viewerExtension); >+ viewerActionBindingElement.setName("viewerActionBinding"); >+ viewerActionBindingElement.setAttribute("viewerId", viewId); >+ >+ IPluginElement includesElement = factory.createElement(viewerActionBindingElement); >+ includesElement.setName("includes"); >+ >+ createChild(includesElement, "actionExtension", "pattern", "org.eclipse.ui.navigator.resources.*"); >+ >+ viewerActionBindingElement.add(includesElement); >+ viewerExtension.add(viewerActionBindingElement); >+ } >+ >+ private void createChild(IPluginElement parent, String name, String attrName, String attrValue) throws CoreException { >+ >+ IPluginElement child = factory.createElement(parent); >+ child.setName(name); >+ child.setAttribute(attrName, attrValue); >+ parent.add(child); >+ } >+ >+ private void createView() throws CoreException { >+ >+ IPluginExtension viewExtension = createExtension("org.eclipse.ui.views", true); //$NON-NLS-1$ >+ IPluginElement viewElement = factory.createElement(viewExtension); >+ viewElement.setName("view"); //$NON-NLS-1$ >+ viewElement.setAttribute("id", viewId); //$NON-NLS-1$ >+ viewElement.setAttribute("name", getStringOption(KEY_VIEW_NAME)); //$NON-NLS-1$ >+// viewElement.setAttribute("icon", "icons/sample.gif"); //$NON-NLS-1$ //$NON-NLS-2$ >+ >+ viewElement.setAttribute("class", "org.eclipse.ui.navigator.CommonNavigator"); //$NON-NLS-1$ //$NON-NLS-2$ >+ viewExtension.add(viewElement); >+ if (!viewExtension.isInTheModel()) >+ plugin.add(viewExtension); >+ } >+ >+ public String[] getNewFiles() { >+ return new String[0]; >+ } >+ >+ public String getUsedExtensionPoint() { >+ return "org.eclipse.ui.navigator.CommonNavigator"; //$NON-NLS-1$ >+ } >+ >+ public void addPages(Wizard wizard) { >+ WizardPage page0 = createPage(0); >+ page0.setTitle("Common Navigator Settings"); >+ page0.setDescription("Choose the options for the Common Navigator"); >+ wizard.addPage(page0); >+ >+ markPagesAdded(); >+ } >+ >+ public IPluginReference[] getDependencies(String schemaVersion) { >+ ArrayList result = new ArrayList(); >+ result.add(new PluginReference("org.eclipse.core.resources", null, 0)); //$NON-NLS-1$ >+ result.add(new PluginReference("org.eclipse.ui.navigator", null, 0)); //$NON-NLS-1$ >+ result.add(new PluginReference("org.eclipse.ui.navigator.resources", null, 0)); //$NON-NLS-1$ >+ return (IPluginReference[]) result.toArray(new IPluginReference[result.size()]); >+ } >+ >+}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
caniszczyk
:
iplog+
Actions:
View
|
Diff
Attachments on
bug 239076
: 106477 |
106847