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 169366 Details for
Bug 313544
[design] view actions still visible when editor is maximized
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]
Fix
bug313544.patch (text/plain), 8.09 KB, created by
Holger Staudacher
on 2010-05-20 11:26:55 EDT
(
hide
)
Description:
Fix
Filename:
MIME Type:
Creator:
Holger Staudacher
Created:
2010-05-20 11:26:55 EDT
Size:
8.09 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.rap.design.example >Index: src/org/eclipse/rap/internal/design/example/stacks/ViewStackPresentation.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.design.example/src/org/eclipse/rap/internal/design/example/stacks/ViewStackPresentation.java,v >retrieving revision 1.24 >diff -u -r1.24 ViewStackPresentation.java >--- src/org/eclipse/rap/internal/design/example/stacks/ViewStackPresentation.java 19 May 2010 14:33:51 -0000 1.24 >+++ src/org/eclipse/rap/internal/design/example/stacks/ViewStackPresentation.java 20 May 2010 15:25:38 -0000 >@@ -88,7 +88,7 @@ > private List buttonList = new ArrayList(); > private Composite toolbarBg; > private Shell toolBarLayer; >- private int state; >+ private int activeState; > protected boolean deactivated; > private Button viewMenuButton; > private Map dirtyListenerMap = new HashMap(); >@@ -97,6 +97,7 @@ > private Map buttonPartMap = new HashMap(); > private IPresentablePart oldPart; > private boolean allActionsVisible; >+ private int state; > > private class DirtyListener implements IPropertyListener { > >@@ -148,7 +149,7 @@ > }; > > public ViewStackPresentation() { >- state = AS_INACTIVE; >+ activeState = AS_INACTIVE; > deactivated = false; > allActionsVisible = ConfigAction.allActionsVisible(); > } >@@ -173,13 +174,11 @@ > registry.addViewPartPresentation( this ); > } > >- > void catchToolbarChange() { > layoutToolBar(); > setBounds( presentationControl.getBounds() ); > } > >- > private void createToolBarBg() { > Composite tabBar = getTabBar(); > toolbarBg = new Composite( tabBar.getParent(), SWT.NONE ); >@@ -204,7 +203,6 @@ > setBounds( parent.getBounds() ); > }; > } ); >- > parent.setData( WidgetUtil.CUSTOM_VARIANT, "compGray" ); > String setID = ILayoutSetConstants.SET_ID_STACKPRESENTATION; > stackBuilder = new StackPresentationBuider( parent, setID ); >@@ -230,7 +228,7 @@ > } else { > decorateStandaloneView( newPart ); > } >- // add the listener for the dirty state >+ // add the listener for the dirty activeState > IPropertyListener listener = new DirtyListener( newPart ); > dirtyListenerMap.put( newPart, listener ); > newPart.addPropertyListener( listener ); >@@ -312,7 +310,7 @@ > getToolBarLayer(); > if( toolBarLayer != null ) { > toolBarLayer.setVisible( false ); >- if( state != AS_ACTIVE_FOCUS ) { >+ if( activeState != AS_ACTIVE_FOCUS ) { > Display display = toolBarLayer.getDisplay(); > Point newLocation = display.map( toolbarBg, null, 0, 0 ); > toolBarLayer.setBounds( newLocation.x, >@@ -401,7 +399,7 @@ > fdPartButton.top = new FormAttachment( 0, 4 ); > fdPartButton.bottom = new FormAttachment( 100 ); > partButton.addSelectionListener( new SelectionAdapter() { >- public void widgetSelected( SelectionEvent e ) { >+ public void widgetSelected( final SelectionEvent e ) { > if( !currentPart.equals( part ) ) { > selectPart( part ); > } >@@ -418,22 +416,8 @@ > }; > } ); > partButton.addListener( SWT.MouseDoubleClick, new Listener() { >- public void handleEvent( Event event ) { >- IWorkbench workbench = PlatformUI.getWorkbench(); >- IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); >- IWorkbenchPage page = window.getActivePage(); >- page.toggleZoom( getReference( part ) ); >- if( toolBarLayer != null ) { >- toolBarLayer.setVisible( false ); >- } >- if( currentPart != null ) { >- currentPart.getControl().moveAbove( null ); >- Control toolBar = currentPart.getToolBar(); >- if( toolBar != null ) { >- toolBar.moveAbove( null ); >- } >- } >- >+ public void handleEvent( final Event event ) { >+ handleToggleZoom( part ); > } > } ); > Composite corner = new Composite( buttonArea, SWT.NONE ); >@@ -454,6 +438,43 @@ > buttonPartMap.put( buttonArea, part ); > buttonList.add( buttonArea ); > } >+ >+ private void handleToggleZoom( final IPresentablePart part ) { >+ IWorkbench workbench = PlatformUI.getWorkbench(); >+ IWorkbenchWindow window = workbench.getActiveWorkbenchWindow(); >+ IWorkbenchPage page = window.getActivePage(); >+ page.toggleZoom( getReference( part ) ); >+ handleToolbarsOnToggleZoom(); >+ } >+ >+ private void handleToolbarsOnToggleZoom() { >+ ViewToolBarRegistry registry = ViewToolBarRegistry.getInstance(); >+ if( state == IStackPresentationSite.STATE_MAXIMIZED ) { >+ registry.moveAllToolbarsBellow( null ); >+ } else if( state == IStackPresentationSite.STATE_RESTORED ) { >+ registry.fireToolBarChanged(); >+ } >+ if( toolBarLayer != null ) { >+ toolBarLayer.setVisible( false ); >+ } >+ if( currentPart != null ) { >+ currentPart.getControl().moveAbove( null ); >+ Control toolBar = currentPart.getToolBar(); >+ if( toolBar != null ) { >+ toolBar.moveAbove( null ); >+ } >+ } >+ } >+ >+ public void hideAllToolBars( final Control control ) { >+ for( int i = 0; i < partList.size(); i++ ) { >+ IPresentablePart part = ( IPresentablePart )partList.get( i ); >+ Control toolBar = part.getToolBar(); >+ if( toolBar != null ) { >+ toolBar.moveBelow( control ); >+ } >+ } >+ } > > protected void activatePart( final IPresentablePart part ) { > IWorkbench workbench = PlatformUI.getWorkbench(); >@@ -695,7 +716,7 @@ > fdOverflowButton.height = icon.getBounds().height; > fdOverflowButton.width = icon.getBounds().width; > String variant = "tabOverflowInactive"; >- if( state == AS_ACTIVE_FOCUS ) { >+ if( activeState == AS_ACTIVE_FOCUS ) { > variant = "tabOverflowActive"; > } > overflowButton.setData( WidgetUtil.CUSTOM_VARIANT, variant ); >@@ -997,7 +1018,7 @@ > } > > public void setActive( final int newState ) { >- state = newState; >+ activeState = newState; > Image confBg = null; > Image cornerImage = null; > Image confImage = null; >@@ -1240,6 +1261,7 @@ > } > > public void setState( final int state ) { >+ this.state = state; > } > > public void setVisible( final boolean isVisible ) { >@@ -1313,4 +1335,5 @@ > } > return result + WIDTH_SPACING; > } >+ > } >Index: src/org/eclipse/rap/internal/design/example/stacks/ViewToolBarRegistry.java >=================================================================== >RCS file: /cvsroot/rt/org.eclipse.rap/runtime.ui/org.eclipse.rap.design.example/src/org/eclipse/rap/internal/design/example/stacks/ViewToolBarRegistry.java,v >retrieving revision 1.1 >diff -u -r1.1 ViewToolBarRegistry.java >--- src/org/eclipse/rap/internal/design/example/stacks/ViewToolBarRegistry.java 31 Aug 2009 13:14:13 -0000 1.1 >+++ src/org/eclipse/rap/internal/design/example/stacks/ViewToolBarRegistry.java 20 May 2010 15:25:38 -0000 >@@ -13,13 +13,14 @@ > import java.util.List; > > import org.eclipse.rwt.SessionSingletonBase; >+import org.eclipse.swt.widgets.Control; > > /** > * This class acts as a registry for ViewStackPresentations. This is necessary > * because the same view can be in different parts. If a toolbar for one part > * change the others should be notified. > */ >-public class ViewToolBarRegistry extends SessionSingletonBase { >+public class ViewToolBarRegistry { > > private List presentationList = new ArrayList(); > >@@ -28,7 +29,9 @@ > } > > public static ViewToolBarRegistry getInstance() { >- return ( ViewToolBarRegistry ) getInstance( ViewToolBarRegistry.class ); >+ Object instance >+ = SessionSingletonBase.getInstance( ViewToolBarRegistry.class ); >+ return ( ViewToolBarRegistry )instance; > } > > public void addViewPartPresentation( >@@ -52,4 +55,14 @@ > } > } > >+ public void moveAllToolbarsBellow( final Control control ) { >+ for( int i = 0; i < presentationList.size(); i++ ) { >+ if( presentationList.get( i ) != null ) { >+ ViewStackPresentation presentation >+ = ( ViewStackPresentation ) presentationList.get( i ); >+ presentation.hideAllToolBars( control ); >+ } >+ } >+ } >+ > }
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
Flags:
b.muskalla
:
review+
Actions:
View
|
Diff
Attachments on
bug 313544
: 169366