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 139542 Details for
Bug 280407
[design] Action's menu is cached and only updated when the viewpart is deactivated and reactivated
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Removes the cahce from the pulldown menu
chachedPulldownMenu (text/plain), 4.22 KB, created by
Holger Staudacher
on 2009-06-18 10:29:45 EDT
(
hide
)
Description:
Removes the cahce from the pulldown menu
Filename:
MIME Type:
Creator:
Holger Staudacher
Created:
2009-06-18 10:29:45 EDT
Size:
4.22 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.design.example >Index: src/org/eclipse/rap/internal/design/example/business/managers/BusinessViewToolBarManager.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.design.example/src/org/eclipse/rap/internal/design/example/business/managers/BusinessViewToolBarManager.java,v >retrieving revision 1.2 >diff -u -r1.2 BusinessViewToolBarManager.java >--- src/org/eclipse/rap/internal/design/example/business/managers/BusinessViewToolBarManager.java 8 Jun 2009 18:41:53 -0000 1.2 >+++ src/org/eclipse/rap/internal/design/example/business/managers/BusinessViewToolBarManager.java 18 Jun 2009 14:30:17 -0000 >@@ -117,26 +117,8 @@ > break; > } > >- Composite parent = control; >- Menu menu = null; >- // pulldown >- if( flags == SWT.DROP_DOWN && item instanceof CommandContributionItem ) { >- CommandContributionItem commandItem = ( CommandContributionItem ) item; >- CommandParameter param >- = CommandUtil.extractCommandInformation( commandItem, control ); >- if( param.getMenu() != null ) { >- menu = param.getMenu(); >- } >- } else if( action instanceof WWinPluginPulldown ) { >- WWinPluginPulldown pulldown = ( WWinPluginPulldown ) action; >- menu = pulldown.getMenuCreator().getMenu( control ); >- } else if( action instanceof IMenuCreator ) { >- IMenuCreator creator = ( IMenuCreator ) action; >- menu = creator.getMenu( control ); >- } else if( action instanceof IWorkbenchWindowPulldownDelegate ) { >- System.out.println("pull"); >- } >- if( menu != null ) { >+ Composite parent = control; >+ if( flags == SWT.DROP_DOWN ) { > final Composite pulldownParent = getPulldownParent(); > parent = pulldownParent; > flags = SWT.PUSH; >@@ -165,7 +147,7 @@ > } > } ); > // pulldown >- if( menu != null ) { >+ if( action.getStyle() == SWT.DROP_DOWN ) { > FormData fdButton = new FormData(); > button.setLayoutData( fdButton ); > fdButton.left = new FormAttachment( 0 ); >@@ -180,13 +162,15 @@ > Image image = builder.getImage( StackInitializer.VIEW_PULLDOWN ); > arrow.setImage( image ); > arrow.setData( WidgetUtil.CUSTOM_VARIANT, "clearButton" ); >- arrow.setMenu( menu ); > arrow.addSelectionListener( new SelectionAdapter() { > public void widgetSelected( final SelectionEvent e ) { > Display display = arrow.getDisplay(); > Point newLoc = display.map( arrow, null, 0, 10 ); >- arrow.getMenu().setVisible( true ); >- arrow.getMenu().setLocation( newLoc ); >+ Menu menu = getActionMenu( action, item ); >+ if( menu != null ) { >+ menu.setVisible( true ); >+ menu.setLocation( newLoc ); >+ } > }; > } ); > } >@@ -194,6 +178,33 @@ > } > } > >+ private Menu getActionMenu( >+ final Action action, >+ final IContributionItem item ) >+ { >+ Menu menu = null; >+ // pulldown >+ if( item instanceof CommandContributionItem ) { >+ CommandContributionItem commandItem = ( CommandContributionItem ) item; >+ CommandParameter param >+ = CommandUtil.extractCommandInformation( commandItem, control ); >+ if( param.getMenu() != null ) { >+ menu = param.getMenu(); >+ } >+ } else if( action instanceof WWinPluginPulldown ) { >+ WWinPluginPulldown pulldown = ( WWinPluginPulldown ) action; >+ menu = pulldown.getMenuCreator().getMenu( control ); >+ } else if( action instanceof IMenuCreator ) { >+ IMenuCreator creator = ( IMenuCreator ) action; >+ menu = creator.getMenu( control ); >+ } else if( action instanceof IWorkbenchWindowPulldownDelegate ) { >+ IWorkbenchWindowPulldownDelegate delegate >+ = ( IWorkbenchWindowPulldownDelegate ) action; >+ menu = delegate.getMenu( control ); >+ } >+ return menu; >+ } >+ > private Composite getPulldownParent() { > final Composite pulldownParent = new Composite( control, SWT.NONE ); > pulldownParent.setLayout( new FormLayout() );
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 280407
:
139538
| 139542