View | Details | Raw Unified | Return to bug 215797 | Differences between
and this patch

Collapse All | Expand All

(-)schema/views.exsd (+8 lines)
Lines 163-168 Link Here
163
               </documentation>
163
               </documentation>
164
            </annotation>
164
            </annotation>
165
         </attribute>
165
         </attribute>
166
         <attribute name="restorable" type="boolean" use="default" value="true">
167
            <annotation>
168
               <documentation>
169
                  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.
170
               </documentation>
171
            </annotation>
172
         </attribute>
166
      </complexType>
173
      </complexType>
167
   </element>
174
   </element>
168
175
Lines 229-234 Link Here
229
      </complexType>
236
      </complexType>
230
   </element>
237
   </element>
231
238
239
232
   <annotation>
240
   <annotation>
233
      <appInfo>
241
      <appInfo>
234
         <meta.section type="examples"/>
242
         <meta.section type="examples"/>
(-)Eclipse UI/org/eclipse/ui/views/IViewDescriptor.java (+7 lines)
Lines 88-91 Link Here
88
     */
88
     */
89
    public boolean getAllowMultiple();
89
    public boolean getAllowMultiple();
90
90
91
    /**
92
     * Returns whether this view can be restored upon workbench restart.
93
     * 
94
     * @return whether whether this view can be restored upon workbench restart
95
     */
96
    public boolean getRestorable();
97
91
}
98
}
(-)Eclipse UI/org/eclipse/ui/internal/registry/ViewDescriptor.java (+8 lines)
Lines 233-238 Link Here
233
    	String string = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ALLOW_MULTIPLE);    	
233
    	String string = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_ALLOW_MULTIPLE);    	
234
        return string == null ? false : Boolean.valueOf(string).booleanValue();
234
        return string == null ? false : Boolean.valueOf(string).booleanValue();
235
    }
235
    }
236
    
237
    /* (non-Javadoc)
238
     * @see org.eclipse.ui.views.IViewDescriptor#getRestorable()
239
     */
240
    public boolean getRestorable() {
241
    	String string = configElement.getAttribute(IWorkbenchRegistryConstants.ATT_RESTORABLE);    	
242
        return string == null ? true : Boolean.valueOf(string).booleanValue();
243
    }
236
244
237
	/* (non-Javadoc)
245
	/* (non-Javadoc)
238
	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
246
	 * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
(-)Eclipse UI/org/eclipse/ui/internal/registry/IWorkbenchRegistryConstants.java (-1 / +6 lines)
Lines 47-52 Link Here
47
	public static String ATT_ALLOW_MULTIPLE = "allowMultiple"; //$NON-NLS-1$
47
	public static String ATT_ALLOW_MULTIPLE = "allowMultiple"; //$NON-NLS-1$
48
48
49
	/**
49
	/**
50
	 * Attribute that specifies whether a view gets restored upon workbench restart. Value <code>restorable</code>.
51
	 */
52
	public static String ATT_RESTORABLE = "restorable"; //$NON-NLS-1$
53
	
54
	/**
50
	 * Attribute that specifies whether a wizard is immediately capable of
55
	 * Attribute that specifies whether a wizard is immediately capable of
51
	 * finishing. Value <code>canFinishEarly</code>.
56
	 * finishing. Value <code>canFinishEarly</code>.
52
	 */
57
	 */
Lines 1302-1308 Link Here
1302
	public static String TAG_SERVICE_FACTORY = "serviceFactory"; //$NON-NLS-1$
1307
	public static String TAG_SERVICE_FACTORY = "serviceFactory"; //$NON-NLS-1$
1303
	
1308
	
1304
	public static String TAG_SERVICE = "service"; //$NON-NLS-1$
1309
	public static String TAG_SERVICE = "service"; //$NON-NLS-1$
1305
	
1310
1306
	public static final String ATTR_FACTORY_CLASS = "factoryClass"; //$NON-NLS-1$
1311
	public static final String ATTR_FACTORY_CLASS = "factoryClass"; //$NON-NLS-1$
1307
1312
1308
	public static final String ATTR_SERVICE_CLASS = "serviceClass"; //$NON-NLS-1$
1313
	public static final String ATTR_SERVICE_CLASS = "serviceClass"; //$NON-NLS-1$
(-)Eclipse UI/org/eclipse/ui/internal/FastViewManager.java (-6 / +8 lines)
Lines 742-753 Link Here
742
				Iterator itr = fvRefs.iterator();
742
				Iterator itr = fvRefs.iterator();
743
				while (itr.hasNext()) {
743
				while (itr.hasNext()) {
744
					IViewReference ref = (IViewReference) itr.next();
744
					IViewReference ref = (IViewReference) itr.next();
745
					IMemento viewMemento = childMem
745
					if(ref.isRestorable()) {
746
							.createChild(IWorkbenchConstants.TAG_VIEW);
746
						IMemento viewMemento = childMem
747
					String id = ViewFactory.getKey(ref);
747
						.createChild(IWorkbenchConstants.TAG_VIEW);
748
					viewMemento.putString(IWorkbenchConstants.TAG_ID, id);
748
						String id = ViewFactory.getKey(ref);
749
					float ratio = perspective.getFastViewWidthRatio(ref);
749
						viewMemento.putString(IWorkbenchConstants.TAG_ID, id);
750
					viewMemento.putFloat(IWorkbenchConstants.TAG_RATIO, ratio);
750
						float ratio = perspective.getFastViewWidthRatio(ref);
751
						viewMemento.putFloat(IWorkbenchConstants.TAG_RATIO, ratio);
752
					}
751
				}
753
				}
752
			}
754
			}
753
		}
755
		}
(-)Eclipse UI/org/eclipse/ui/internal/ViewReference.java (-8 / +11 lines)
Lines 10-29 Link Here
10
 *******************************************************************************/
10
 *******************************************************************************/
11
package org.eclipse.ui.internal;
11
package org.eclipse.ui.internal;
12
12
13
import org.eclipse.osgi.util.NLS;
14
15
import org.eclipse.swt.SWT;
16
import org.eclipse.swt.layout.FillLayout;
17
import org.eclipse.swt.widgets.Composite;
18
19
import org.eclipse.core.runtime.IConfigurationElement;
13
import org.eclipse.core.runtime.IConfigurationElement;
20
import org.eclipse.core.runtime.IStatus;
14
import org.eclipse.core.runtime.IStatus;
21
import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
15
import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker;
22
23
import org.eclipse.jface.action.ContributionManager;
16
import org.eclipse.jface.action.ContributionManager;
24
import org.eclipse.jface.action.IAction;
17
import org.eclipse.jface.action.IAction;
25
import org.eclipse.jface.resource.ImageDescriptor;
18
import org.eclipse.jface.resource.ImageDescriptor;
26
19
import org.eclipse.osgi.util.NLS;
20
import org.eclipse.swt.SWT;
21
import org.eclipse.swt.layout.FillLayout;
22
import org.eclipse.swt.widgets.Composite;
27
import org.eclipse.ui.IKeyBindingService;
23
import org.eclipse.ui.IKeyBindingService;
28
import org.eclipse.ui.IMemento;
24
import org.eclipse.ui.IMemento;
29
import org.eclipse.ui.IViewPart;
25
import org.eclipse.ui.IViewPart;
Lines 500-503 Link Here
500
	public IMemento getMemento() {
496
	public IMemento getMemento() {
501
		return memento;
497
		return memento;
502
	}
498
	}
499
	
500
	/* (non-Javadoc)
501
	 * @see org.eclipse.ui.IViewReference#isRestorable()
502
	 */
503
	public boolean isRestorable() {
504
		return this.factory.getViewRegistry().find(getId()).getRestorable();
505
	}
503
}
506
}
(-)Eclipse UI/org/eclipse/ui/internal/Perspective.java (-4 / +6 lines)
Lines 1665-1674 Link Here
1665
        while (itr.hasNext()) {
1665
        while (itr.hasNext()) {
1666
            ViewPane pane = (ViewPane) itr.next();
1666
            ViewPane pane = (ViewPane) itr.next();
1667
            IViewReference ref = pane.getViewReference();
1667
            IViewReference ref = pane.getViewReference();
1668
            IMemento viewMemento = memento
1668
			if(ref.isRestorable()) {
1669
                    .createChild(IWorkbenchConstants.TAG_VIEW);
1669
	            IMemento viewMemento = memento
1670
            viewMemento.putString(IWorkbenchConstants.TAG_ID, ViewFactory
1670
	                    .createChild(IWorkbenchConstants.TAG_VIEW);
1671
                    .getKey(ref));
1671
	            viewMemento.putString(IWorkbenchConstants.TAG_ID, ViewFactory
1672
	                    .getKey(ref));
1673
			}
1672
        }
1674
        }
1673
1675
1674
        // save all fastview state
1676
        // save all fastview state
(-)Eclipse UI/org/eclipse/ui/IViewReference.java (+5 lines)
Lines 40-43 Link Here
40
     * Returns true if the view is a fast view otherwise returns false.
40
     * Returns true if the view is a fast view otherwise returns false.
41
     */
41
     */
42
    public boolean isFastView();
42
    public boolean isFastView();
43
    
44
    /**
45
     * Returns true if the view is restorable otherwise returns false.
46
     */
47
    public boolean isRestorable();
43
}
48
}

Return to bug 215797