Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "RapTipsTricks"

Line 2: Line 2:
  
 
This section intends to host tricks and tips, snippets, ..., about RAP and RWT... Any help is welcome.
 
This section intends to host tricks and tips, snippets, ..., about RAP and RWT... Any help is welcome.
 +
 +
=Workbench Window=
 +
 +
==Fill the browser with the Workbench Window==
 +
 +
To make the main RAP Workbench Window shell fill the browser and resize with the browser window.
 +
 +
In your WorkbenchWindowAdvisor class:
 +
<source lang="java">
 +
  public void preWindowOpen() {
 +
    IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
 +
    configurer.setShowStatusLine( false );
 +
    configurer.setTitle( "Your app" );
 +
    configurer.setShellStyle( SWT.NONE );
 +
    Rectangle bounds = Display.getDefault().getBounds();
 +
    configurer.setInitialSize(new Point(bounds.width, bounds.height));
 +
  }
 +
 +
  public void postWindowOpen() {
 +
    final IWorkbenchWindow window = getWindowConfigurer().getWindow();
 +
    Shell shell = window.getShell();
 +
    shell.setMaximized( true );
 +
  }
 +
</source>
 +
 +
 +
 +
Cheers,
 +
 +
Jochen
 +
 +
 +
Wayne Beaton wrote:
 +
> What's the magic to make my workbench window occupy the entire area
 +
> available in the browser? I swear that I've seen this before, but can't
 +
> seem to find the right incantation for Google...
 +
>
 +
> Ideally, I'd like the workbench window to resize with the browser
 +
> (which, again, I swear I've seen before).
  
 
[[Category:RAP]]
 
[[Category:RAP]]

Revision as of 21:20, 3 April 2008

| RAP wiki home | RAP project home |

This section intends to host tricks and tips, snippets, ..., about RAP and RWT... Any help is welcome.

Workbench Window

Fill the browser with the Workbench Window

To make the main RAP Workbench Window shell fill the browser and resize with the browser window.

In your WorkbenchWindowAdvisor class:

   public void preWindowOpen() {
     IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
     configurer.setShowStatusLine( false );
     configurer.setTitle( "Your app" );
     configurer.setShellStyle( SWT.NONE );
     Rectangle bounds = Display.getDefault().getBounds();
     configurer.setInitialSize(new Point(bounds.width, bounds.height));
   }
 
   public void postWindowOpen() {
     final IWorkbenchWindow window = getWindowConfigurer().getWindow();
     Shell shell = window.getShell();
     shell.setMaximized( true );
   }


Cheers,

Jochen


Wayne Beaton wrote: > What's the magic to make my workbench window occupy the entire area > available in the browser? I swear that I've seen this before, but can't > seem to find the right incantation for Google... > > Ideally, I'd like the workbench window to resize with the browser > (which, again, I swear I've seen before).

Back to the top