Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Minimizing, maximizing and restoring views, editors programatically
Minimizing, maximizing and restoring views, editors programatically [message #523130] Thu, 25 March 2010 09:13 Go to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hello,

im trying to do the following:

on the left i have one view that is used als menue. it takes about 20 % of the screen width, and 100% of the heigth. on the right side (80% of the width) there should be either a view containing a tableviewer with elements, and when i click on some element, the view with the tableviewer should minimize, an editor should open, and maximize in that way that the menu on the left ist whole time visible for 20 % of the screen width. when i close the editor, the view with the table should maxmize again, but the menue view should still stay visible, with that 20% screen width.
Its probalby eays, but im dont getting it.

Regards, Edin
Re: Minimizing, maximizing and restoring views, editors programatically [message #523200 is a reply to message #523130] Thu, 25 March 2010 09:08 Go to previous messageGo to next message
Ralf Sternberg is currently offline Ralf SternbergFriend
Messages: 1313
Registered: July 2009
Senior Member

Hi Edin,

If you want your navigation on the left to always cover a fixed part of
the window, no matter what happens to the perspective, you should
exclude this part from the perspective by overriding
WorkbenchWindowAdvosor#createWindowContents()

This way you can define your own layout for the main window. This layout
will contain your 20% Navigation Menu on the left and the pageComposite
will cover the remaining 80%.

Regards, Ralf

ededagic wrote:
> Hello,
>
> im trying to do the following:
>
> on the left i have one view that is used als menue. it takes about 20 %
> of the screen width, and 100% of the heigth. on the right side (80% of
> the width) there should be either a view containing a tableviewer with
> elements, and when i click on some element, the view with the
> tableviewer should minimize, an editor should open, and maximize in that
> way that the menu on the left ist whole time visible for 20 % of the
> screen width. when i close the editor, the view with the table should
> maxmize again, but the menue view should still stay visible, with that
> 20% screen width.
> Its probalby eays, but im dont getting it.
>
> Regards, Edin
Re: Minimizing, maximizing and restoring views, editors programatically [message #551605 is a reply to message #523200] Sat, 07 August 2010 23:13 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hi,

i tried to do sth. in that way, but it doesnt work for me. For testing i wrote the folowing:
public void createWindowContents(Shell shell) {
Section section = new Section(shell, Section.TWISTIE | Section.DESCRIPTION);

//some code setting sections properites 20% of the shell, should contain manueView
.
.//
Shell mainShell = new Shell(shell, SWT.NONE);
// some code creating new shell as child of the origin shell with 80 % of the origin shell
.
//
// now want to screate standard context within the new shell
super.createWindowContents(mainShell);
}

but it doesnt work, im getting Wrong parent SWT exception when i create the new shell. im not such expert about swt. perhaps can you give me some code example or tell me what im doing wrong ?
By the way, is it possible to use section to expand horizontaly, or is there some other expandable composite that can expand hirizontally, or is there some other trick how to show and hide a view with the menue by the button click on the left?

Best regards, edin
Re: Minimizing, maximizing and restoring views, editors programatically [message #551631 is a reply to message #523130] Sun, 08 August 2010 14:08 Go to previous messageGo to next message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
okay, i found out how it works. its seems to works fine, but perhaps there is sth i perhaps forgot:

public void createWindowContents(Shell shell) {
		FormLayout layout = new FormLayout();
		shell.setLayout(layout);

		IWorkbenchWindowConfigurer configurer = getWindowConfigurer();

		Menu menu = configurer.createMenuBar();
		shell.setMenuBar(menu);

		FormData formData = new FormData();
		formData.left = new FormAttachment(0);
		formData.right = new FormAttachment(100);
		Control coolBar = configurer.createCoolBarControl(shell);
		coolBar.setLayoutData(formData);

		Control statusLine = configurer.createStatusLineControl(shell);
		formData = new FormData();
		formData.left = new FormAttachment(0);
		formData.right = new FormAttachment(100);
		formData.bottom = new FormAttachment(100);
		statusLine.setLayoutData(formData);

		Composite menuComposite = new Composite(shell, SWT.NONE);
		ExpandViewImpl impl = new ExpandViewImpl();
		impl.createPartControl(menuComposite);
		PartReferences.addView("menuView", impl);
		formData = new FormData();
		formData.top = new FormAttachment(coolBar, 0, SWT.BOTTOM);
		formData.left = new FormAttachment(0);
		formData.right = new FormAttachment(20, 0);
		formData.bottom = new FormAttachment(statusLine, 0, SWT.TOP);
		menuComposite.setLayoutData(formData);

		Control mainPage = configurer.createPageComposite(shell);
		formData = new FormData();
		formData.top = new FormAttachment(coolBar, 0, SWT.BOTTOM);
		formData.left = new FormAttachment(menuComposite);
		formData.right = new FormAttachment(100);
		formData.bottom = new FormAttachment(statusLine, 0, SWT.TOP);
		mainPage.setLayoutData(formData);
	}


Thx, Edin
Re: Minimizing, maximizing and restoring views, editors programatically [message #633031 is a reply to message #551631] Fri, 15 October 2010 07:34 Go to previous message
Edin Edin is currently offline Edin EdinFriend
Messages: 101
Registered: January 2010
Senior Member
Hello, me again,

i have the following problem:
in my app, i have on the left the menue view, on the right (about 80%) are other views and editor. i have 5 different views, 3 of them should take the whole right area, when they are opened. if i open the 4th one, it should take the 60 percent of the right area at top, and the 5th one should take the the rest (40% of the right area at the bottom). Editor should always be at 100% of the right area and it works now sofar. is there any way to realise this easily (in the perspective class for example, with placeholder etc.), without programming own classes again?
another question, is it possible, to define placeholders in perspective class, but they shouldnt be visible as long as no views are opened in it?

Regards, Edin
Previous Topic:Problem with TableViewer setAlignment on column
Next Topic:How-To BrowserHistory
Goto Forum:
  


Current Time: Tue Apr 23 17:54:14 GMT 2024

Powered by FUDForum. Page generated in 0.03010 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top