|
Lines 29-41
Link Here
|
| 29 |
* is always a PartSashContainer (or null), and its children are always either PartPlaceholders or ViewPanes. |
29 |
* is always a PartSashContainer (or null), and its children are always either PartPlaceholders or ViewPanes. |
| 30 |
* This contains the real behavior and state for stacks of views, although the widgets for the tabs are contributed |
30 |
* This contains the real behavior and state for stacks of views, although the widgets for the tabs are contributed |
| 31 |
* using a StackPresentation. |
31 |
* using a StackPresentation. |
| 32 |
* |
32 |
* |
| 33 |
* TODO: eliminate ViewStack and EditorStack. PartStack should be general enough to handle editors |
33 |
* TODO: eliminate ViewStack and EditorStack. PartStack should be general enough to handle editors |
| 34 |
* and views without any specialization for editors and views. The differences should be in the |
34 |
* and views without any specialization for editors and views. The differences should be in the |
| 35 |
* presentation and in the PartPanes themselves. |
35 |
* presentation and in the PartPanes themselves. |
| 36 |
* |
36 |
* |
| 37 |
* TODO: eliminate PartPlaceholder. Placeholders should not be children of the ViewStack. |
37 |
* TODO: eliminate PartPlaceholder. Placeholders should not be children of the ViewStack. |
| 38 |
* |
38 |
* |
| 39 |
*/ |
39 |
*/ |
| 40 |
public class ViewStack extends PartStack { |
40 |
public class ViewStack extends PartStack { |
| 41 |
|
41 |
|
|
Lines 48-54
Link Here
|
| 48 |
private SystemMenuFastView fastViewAction; |
48 |
private SystemMenuFastView fastViewAction; |
| 49 |
|
49 |
|
| 50 |
private SystemMenuDetach detachViewAction; |
50 |
private SystemMenuDetach detachViewAction; |
| 51 |
|
51 |
|
| 52 |
public void addSystemActions(IMenuManager menuManager) { |
52 |
public void addSystemActions(IMenuManager menuManager) { |
| 53 |
appendToGroupIfPossible(menuManager, |
53 |
appendToGroupIfPossible(menuManager, |
| 54 |
"misc", new UpdatingActionContributionItem(fastViewAction)); //$NON-NLS-1$ |
54 |
"misc", new UpdatingActionContributionItem(fastViewAction)); //$NON-NLS-1$ |
|
Lines 92-103
Link Here
|
| 92 |
return false; |
92 |
return false; |
| 93 |
} |
93 |
} |
| 94 |
|
94 |
|
|
|
95 |
// We need to search if one of the presentations is not moveable |
| 96 |
// if that's the case the whole folder should not be moveable |
| 97 |
IStackPresentationSite presenationSite; |
| 98 |
|
| 99 |
if( (presenationSite = getPresentationSite()) != null ) { |
| 100 |
IPresentablePart[] parts = presenationSite.getPartList(); |
| 101 |
for( int i = 0; i < parts.length; i++ ) { |
| 102 |
if( !presenationSite.isPartMoveable(parts[i]) ) { |
| 103 |
return false; |
| 104 |
} |
| 105 |
} |
| 106 |
} |
| 107 |
|
| 95 |
return !perspective.isFixedLayout(); |
108 |
return !perspective.isFixedLayout(); |
| 96 |
} |
109 |
} |
| 97 |
|
110 |
|
| 98 |
protected void updateActions(PresentablePart current) { |
111 |
protected void updateActions(PresentablePart current) { |
| 99 |
ViewPane pane = null; |
112 |
ViewPane pane = null; |
| 100 |
|
113 |
|
| 101 |
if (current != null && current.getPane() instanceof ViewPane) { |
114 |
if (current != null && current.getPane() instanceof ViewPane) { |
| 102 |
pane = (ViewPane) current.getPane(); |
115 |
pane = (ViewPane) current.getPane(); |
| 103 |
} |
116 |
} |
|
Lines 111-117
Link Here
|
| 111 |
* Sets the minimized state for this stack. The part may call this method to |
124 |
* Sets the minimized state for this stack. The part may call this method to |
| 112 |
* minimize or restore itself. The minimized state only affects the view |
125 |
* minimize or restore itself. The minimized state only affects the view |
| 113 |
* when unzoomed. |
126 |
* when unzoomed. |
| 114 |
* |
127 |
* |
| 115 |
* This implementation is specific to the 3.3 presentation's |
128 |
* This implementation is specific to the 3.3 presentation's |
| 116 |
* min/max story; otherwise it just forwards the call. |
129 |
* min/max story; otherwise it just forwards the call. |
| 117 |
*/ |
130 |
*/ |
|
Lines 130-140
Link Here
|
| 130 |
maxStack.setState(IStackPresentationSite.STATE_RESTORED); |
143 |
maxStack.setState(IStackPresentationSite.STATE_RESTORED); |
| 131 |
} |
144 |
} |
| 132 |
} |
145 |
} |
| 133 |
|
146 |
|
| 134 |
fvm.restoreToPresentation(getID()); |
147 |
fvm.restoreToPresentation(getID()); |
| 135 |
} |
148 |
} |
| 136 |
} |
149 |
} |
| 137 |
|
150 |
|
| 138 |
super.setMinimized(minimized); |
151 |
super.setMinimized(minimized); |
| 139 |
} |
152 |
} |
| 140 |
|
153 |
|
|
Lines 179-185
Link Here
|
| 179 |
/** |
192 |
/** |
| 180 |
* Get the presentation for testing purposes. This is for testing |
193 |
* Get the presentation for testing purposes. This is for testing |
| 181 |
* purposes <b>ONLY</b>. |
194 |
* purposes <b>ONLY</b>. |
| 182 |
* |
195 |
* |
| 183 |
* @return the presentation in use for this view stack |
196 |
* @return the presentation in use for this view stack |
| 184 |
* @since 3.2 |
197 |
* @since 3.2 |
| 185 |
*/ |
198 |
*/ |