|
Lines 60-65
Link Here
|
| 60 |
*/ |
60 |
*/ |
| 61 |
public abstract class ConfigurableStack extends StackPresentation { |
61 |
public abstract class ConfigurableStack extends StackPresentation { |
| 62 |
|
62 |
|
|
|
63 |
public static final String VIEW_ACTION_VISIBILITY = "viewActionVisibility"; |
| 64 |
|
| 63 |
private static final String CONFIG_ACTION_NAME = "actionClass"; |
65 |
private static final String CONFIG_ACTION_NAME = "actionClass"; |
| 64 |
|
66 |
|
| 65 |
private static IStackPresentationSite siteDummy |
67 |
private static IStackPresentationSite siteDummy |
|
Lines 235-264
Link Here
|
| 235 |
PresentablePart part = ( PresentablePart ) selectedPart; |
237 |
PresentablePart part = ( PresentablePart ) selectedPart; |
| 236 |
result = part.getPane().getToolBar(); |
238 |
result = part.getPane().getToolBar(); |
| 237 |
} |
239 |
} |
| 238 |
// set the correct visibility |
240 |
|
| 239 |
for( int i = 0; i < items.length; i++ ) { |
241 |
// check if all actions are visible or not |
| 240 |
if( items[ i ] instanceof ActionContributionItem ) { |
242 |
IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore(); |
| 241 |
// actions |
243 |
boolean actionsVisible |
| 242 |
ActionContributionItem actionItem |
244 |
= apiPreferenceStore.getBoolean( VIEW_ACTION_VISIBILITY ); |
| 243 |
= ( ActionContributionItem ) items[ i ]; |
245 |
if( !actionsVisible ) { |
| 244 |
String actionId = actionItem.getAction().getId(); |
246 |
// set the correct visibility |
| 245 |
boolean isVisible |
247 |
for( int i = 0; i < items.length; i++ ) { |
| 246 |
= action.isViewActionVisibile( paneId, actionId ); |
248 |
if( items[ i ] instanceof ActionContributionItem ) { |
| 247 |
actionItem.setVisible( isVisible ); |
249 |
// actions |
| 248 |
if( isVisible ) { |
250 |
ActionContributionItem actionItem |
| 249 |
actionCount++; |
251 |
= ( ActionContributionItem ) items[ i ]; |
|
|
252 |
String actionId = actionItem.getAction().getId(); |
| 253 |
boolean isVisible |
| 254 |
= action.isViewActionVisibile( paneId, actionId ); |
| 255 |
actionItem.setVisible( isVisible ); |
| 256 |
if( isVisible ) { |
| 257 |
actionCount++; |
| 258 |
} |
| 259 |
} else if( items[ i ] instanceof CommandContributionItem ) { |
| 260 |
// commands |
| 261 |
CommandContributionItem commandItem |
| 262 |
= ( CommandContributionItem ) items[ i ]; |
| 263 |
boolean isVisible |
| 264 |
= action.isViewActionVisibile( paneId, commandItem.getId() ); |
| 265 |
commandItem.setVisible( isVisible ); |
| 266 |
if( isVisible ) { |
| 267 |
actionCount++; |
| 268 |
} |
| 250 |
} |
269 |
} |
| 251 |
} else if( items[ i ] instanceof CommandContributionItem ) { |
|
|
| 252 |
// commands |
| 253 |
CommandContributionItem commandItem |
| 254 |
= ( CommandContributionItem ) items[ i ]; |
| 255 |
boolean isVisible |
| 256 |
= action.isViewActionVisibile( paneId, commandItem.getId() ); |
| 257 |
commandItem.setVisible( isVisible ); |
| 258 |
if( isVisible ) { |
| 259 |
actionCount++; |
| 260 |
} |
| 261 |
} |
270 |
} |
|
|
271 |
} else { |
| 272 |
actionCount = 1; |
| 262 |
} |
273 |
} |
| 263 |
|
274 |
|
| 264 |
// update the toolbar manager with the new visibility |
275 |
// update the toolbar manager with the new visibility |
|
Lines 552-558
Link Here
|
| 552 |
|
563 |
|
| 553 |
private boolean isPartMenuVisisble() { |
564 |
private boolean isPartMenuVisisble() { |
| 554 |
boolean result = false; |
565 |
boolean result = false; |
| 555 |
if( configAction != null ) { |
566 |
IPreferenceStore apiPreferenceStore = PrefUtil.getAPIPreferenceStore(); |
|
|
567 |
result = apiPreferenceStore.getBoolean( VIEW_ACTION_VISIBILITY ); |
| 568 |
if( configAction != null && !result ) { |
| 556 |
result = configAction.isPartMenuVisible(); |
569 |
result = configAction.isPartMenuVisible(); |
| 557 |
} |
570 |
} |
| 558 |
|
571 |
|