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 87498 Details for
Bug 215797
[ViewMgmt] [WorkbenchParts] Extends org.eclipse.ui.views EP to allow non-restorable views
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
[patch]
preliminary patch handling the basic cases
clipboard.txt (text/plain), 8.92 KB, created by
Markus Kuppe
on 2008-01-22 05:13:42 EST
(
hide
)
Description:
preliminary patch handling the basic cases
Filename:
MIME Type:
Creator:
Markus Kuppe
Created:
2008-01-22 05:13:42 EST
Size:
8.92 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.ui >Index: schema/views.exsd >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui/schema/views.exsd,v >retrieving revision 1.16 >diff -u -r1.16 views.exsd >--- schema/views.exsd 21 Jun 2005 19:37:43 -0000 1.16 >+++ schema/views.exsd 22 Jan 2008 10:11:49 -0000 >@@ -163,6 +163,13 @@ > </documentation> > </annotation> > </attribute> >+ <attribute name="restorable" type="boolean" use="default" value="true"> >+ <annotation> >+ <documentation> >+ flag indicating whether this view allows to be restored upon workbench restart. If set to false, the view will not be open after a workbench restart. The default is true. >+ </documentation> >+ </annotation> >+ </attribute> > </complexType> > </element> > >@@ -229,6 +236,7 @@ > </complexType> > </element> > >+ > <annotation> > <appInfo> > <meta.section type="examples"/> >#P org.eclipse.ui.workbench >Index: Eclipse UI/org/eclipse/ui/views/IViewDescriptor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/views/IViewDescriptor.java,v >retrieving revision 1.3 >diff -u -r1.3 IViewDescriptor.java >--- Eclipse UI/org/eclipse/ui/views/IViewDescriptor.java 14 Mar 2005 17:02:52 -0000 1.3 >+++ Eclipse UI/org/eclipse/ui/views/IViewDescriptor.java 22 Jan 2008 10:11:55 -0000 >@@ -88,4 +88,11 @@ > */ > public boolean getAllowMultiple(); > >+ /** >+ * Returns whether this view can be restored upon workbench restart. >+ * >+ * @return whether whether this view can be restored upon workbench restart >+ */ >+ public boolean getRestorable(); >+ > } >Index: Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java,v >retrieving revision 1.34 >diff -u -r1.34 ViewDescriptor.java >--- Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java 28 Nov 2007 21:56:43 -0000 1.34 >+++ Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java 22 Jan 2008 10:11:54 -0000 >@@ -233,6 +233,14 @@ > String string = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ALLOW_MULTIPLE); > return string == null ? false : Boolean.valueOf(string).booleanValue(); > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.views.IViewDescriptor#getRestorable() >+ */ >+ public boolean getRestorable() { >+ String string = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_RESTORABLE); >+ return string == null ? true : Boolean.valueOf(string).booleanValue(); >+ } > > /* (non-Javadoc) > * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) >Index: Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java,v >retrieving revision 1.33 >diff -u -r1.33 IWorkbenchRegistryConstants.java >--- Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java 7 Dec 2007 18:39:03 -0000 1.33 >+++ Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java 22 Jan 2008 10:11:54 -0000 >@@ -47,6 +47,11 @@ > public static String ATT_ALLOW_MULTIPLE = "allowMultiple"; //$NON-NLS-1$ > > /** >+ * Attribute that specifies whether a view gets restored upon workbench restart. Value <code>restorable</code>. >+ */ >+ public static String ATT_RESTORABLE = "restorable"; //$NON-NLS-1$ >+ >+ /** > * Attribute that specifies whether a wizard is immediately capable of > * finishing. Value <code>canFinishEarly</code>. > */ >@@ -1302,7 +1307,7 @@ > public static String TAG_SERVICE_FACTORY = "serviceFactory"; //$NON-NLS-1$ > > public static String TAG_SERVICE = "service"; //$NON-NLS-1$ >- >+ > public static final String ATTR_FACTORY_CLASS = "factoryClass"; //$NON-NLS-1$ > > public static final String ATTR_SERVICE_CLASS = "serviceClass"; //$NON-NLS-1$ >Index: Eclipse UI/org/eclipse/ui/internal/FastViewManager.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/FastViewManager.java,v >retrieving revision 1.21 >diff -u -r1.21 FastViewManager.java >--- Eclipse UI/org/eclipse/ui/internal/FastViewManager.java 15 May 2007 18:34:19 -0000 1.21 >+++ Eclipse UI/org/eclipse/ui/internal/FastViewManager.java 22 Jan 2008 10:11:51 -0000 >@@ -742,12 +742,14 @@ > Iterator itr = fvRefs.iterator(); > while (itr.hasNext()) { > IViewReference ref = (IViewReference) itr.next(); >- IMemento viewMemento = childMem >- .createChild(IWorkbenchConstants.TAG_VIEW); >- String id = ViewFactory.getKey(ref); >- viewMemento.putString(IWorkbenchConstants.TAG_ID, id); >- float ratio = perspective.getFastViewWidthRatio(ref); >- viewMemento.putFloat(IWorkbenchConstants.TAG_RATIO, ratio); >+ if(ref.isRestorable()) { >+ IMemento viewMemento = childMem >+ .createChild(IWorkbenchConstants.TAG_VIEW); >+ String id = ViewFactory.getKey(ref); >+ viewMemento.putString(IWorkbenchConstants.TAG_ID, id); >+ float ratio = perspective.getFastViewWidthRatio(ref); >+ viewMemento.putFloat(IWorkbenchConstants.TAG_RATIO, ratio); >+ } > } > } > } >Index: Eclipse UI/org/eclipse/ui/internal/ViewReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/ViewReference.java,v >retrieving revision 1.29 >diff -u -r1.29 ViewReference.java >--- Eclipse UI/org/eclipse/ui/internal/ViewReference.java 14 Nov 2007 07:59:50 -0000 1.29 >+++ Eclipse UI/org/eclipse/ui/internal/ViewReference.java 22 Jan 2008 10:11:52 -0000 >@@ -10,20 +10,16 @@ > *******************************************************************************/ > package org.eclipse.ui.internal; > >-import org.eclipse.osgi.util.NLS; >- >-import org.eclipse.swt.SWT; >-import org.eclipse.swt.layout.FillLayout; >-import org.eclipse.swt.widgets.Composite; >- > import org.eclipse.core.runtime.IConfigurationElement; > import org.eclipse.core.runtime.IStatus; > import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker; >- > import org.eclipse.jface.action.ContributionManager; > import org.eclipse.jface.action.IAction; > import org.eclipse.jface.resource.ImageDescriptor; >- >+import org.eclipse.osgi.util.NLS; >+import org.eclipse.swt.SWT; >+import org.eclipse.swt.layout.FillLayout; >+import org.eclipse.swt.widgets.Composite; > import org.eclipse.ui.IKeyBindingService; > import org.eclipse.ui.IMemento; > import org.eclipse.ui.IViewPart; >@@ -500,4 +496,11 @@ > public IMemento getMemento() { > return memento; > } >+ >+ /* (non-Javadoc) >+ * @see org.eclipse.ui.IViewReference#isRestorable() >+ */ >+ public boolean isRestorable() { >+ return this.factory.getViewRegistry().find(getId()).getRestorable(); >+ } > } >Index: Eclipse UI/org/eclipse/ui/internal/Perspective.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/internal/Perspective.java,v >retrieving revision 1.166 >diff -u -r1.166 Perspective.java >--- Eclipse UI/org/eclipse/ui/internal/Perspective.java 11 Oct 2007 16:08:27 -0000 1.166 >+++ Eclipse UI/org/eclipse/ui/internal/Perspective.java 22 Jan 2008 10:11:52 -0000 >@@ -1665,10 +1665,12 @@ > while (itr.hasNext()) { > ViewPane pane = (ViewPane) itr.next(); > IViewReference ref = pane.getViewReference(); >- IMemento viewMemento = memento >- .createChild(IWorkbenchConstants.TAG_VIEW); >- viewMemento.putString(IWorkbenchConstants.TAG_ID, ViewFactory >- .getKey(ref)); >+ if(ref.isRestorable()) { >+ IMemento viewMemento = memento >+ .createChild(IWorkbenchConstants.TAG_VIEW); >+ viewMemento.putString(IWorkbenchConstants.TAG_ID, ViewFactory >+ .getKey(ref)); >+ } > } > > // save all fastview state >Index: Eclipse UI/org/eclipse/ui/IViewReference.java >=================================================================== >RCS file: /cvsroot/eclipse/org.eclipse.ui.workbench/Eclipse UI/org/eclipse/ui/IViewReference.java,v >retrieving revision 1.11 >diff -u -r1.11 IViewReference.java >--- Eclipse UI/org/eclipse/ui/IViewReference.java 16 Mar 2007 18:00:37 -0000 1.11 >+++ Eclipse UI/org/eclipse/ui/IViewReference.java 22 Jan 2008 10:11:51 -0000 >@@ -40,4 +40,9 @@ > * Returns true if the view is a fast view otherwise returns false. > */ > public boolean isFastView(); >+ >+ /** >+ * Returns true if the view is restorable otherwise returns false. >+ */ >+ public boolean isRestorable(); > }
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
Actions:
View
|
Diff
Attachments on
bug 215797
:
87498
|
87499
|
92934
|
92935
|
92980
|
93779