DZone Forums
Go Back   DZone Forums > Community > Tools & IDEs > Eclipse
Reload this Page Get ProgressBar on Customized StatusBar
Notices
Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  (#1 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Sep 2009
Post Get ProgressBar on Customized StatusBar - 09-09-2009, 07:34 AM

Can anyone help me to solve the following problem?

Problem - We have Override createWindowContents(Shell shell) method in the class ApplicationWorkbenchWindowAdvisor, which is causing statusbar to disappear. So, to get status bar I have written the following code and I am getting it back. But, I could not able to create progress bar view on that status bar. Please help me if anyone know how to do that...

API used to create StatusBar -
configurer.createStatusLineControl(shell);

I tried to create Progress Bar as :
progressRegion = new ProgressRegion();
progressRegion.createContents(control, window);

But it was not working as expected...

Note : No use on calling
configurer.setShowProgressIndicator(true);


Can anyone help me?


Cheers
Satya
Reply With Quote
  (#2 (permalink)) Old
Member
 
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Aug 2009
Default 09-09-2009, 07:45 AM

What do you mean by "No use on calling configurer.setShowProgressIndicator(true)" ?
This is the right way to do what you want.

Regards,

Benoit
Reply With Quote
  (#3 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Sep 2009
Default 09-09-2009, 07:51 AM

configurer.setShowProgressIndicator(true) is working for default status bar. But if we create owr own statusbar by overriding the method createWindowContents(Shell), then there is no use of calling configurer.setShowProgressIndicator(true).

Please let me know if you want any more information...

Cheers,
Satya
Reply With Quote
  (#4 (permalink)) Old
Member
 
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Aug 2009
Default 09-09-2009, 08:40 AM

In my understanding, you have to create yourself the ProgressRegion (as does the createProgressIndicator in WorkbenchWindow class).

Hope this helps,

Benoit
Reply With Quote
  (#5 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Sep 2009
Default 09-10-2009, 06:06 AM

I have tried creating the progressBar exactly the same way it is doing in createProgressIndicator in WorkbenchWindow class except the layout using for shell.I am using the layout as FormLayout.

Still I am not getting Progressbar. Please see the following code and suggest me whether I am doing anything wrong...

public void createWindowContents(Shell shell) {

----------- do something-------------
final IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
FormLayout layout = new FormLayout();
layout.marginWidth = 0;
layout.marginHeight = 0;
shell.setLayout(layout);

----------- do something-------------

status = configurer.createStatusLineControl(shell);
createProgressIndicator(shell);
layoutNormal();

((WorkbenchWindow)(configurer.getWindow()))
.getStatusLineManager().getControl().setVisible(tr ue);

progressRegion.getControl().setVisible(true);
}

private void createProgressIndicator(Composite shell) {
if (getWindowConfigurer().getShowProgressIndicator()) {
WorkbenchWindow window = (WorkbenchWindow) getWindowConfigurer().getWindow();
progressRegion = new ProgressRegion();
progressRegion.createContents(shell, window);
}
}

private void layoutNormal() {

// Toolbar
FormData data = new FormData();
data.top = new FormAttachment(0, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
logo.setLayoutData(data);

data = new FormData();
data.top = new FormAttachment(this.logo, 0, SWT.BOTTOM);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
toolbar.setLayoutData(data);

// Status line
data = new FormData();
data.bottom = new FormAttachment(100, 0);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(progressRegion.getControl());
status.setLayoutData(data);
// page contents
data = new FormData();
data.top = new FormAttachment(toolbar);
data.left = new FormAttachment(0, 0);
data.right = new FormAttachment(100, 0);
data.bottom = new FormAttachment(status);
page.setLayoutData(data);
getWindowConfigurer().getWindow().getShell().layou t(true);

}

Cheets
Satya
Reply With Quote
  (#6 (permalink)) Old
Member
 
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Aug 2009
Default 09-10-2009, 06:55 AM

Quote:
private void createProgressIndicator(Composite shell) {
if (getWindowConfigurer().getShowProgressIndicator()) {
WorkbenchWindow window = (WorkbenchWindow) getWindowConfigurer().getWindow();
progressRegion = new ProgressRegion();
progressRegion.createContents(shell, window);
}
}
Are you still calling "configuer.setShowProgressIndicator(true)" before ? (as your createProgressIndicator uses getWindowConfigurer().getShowProgressIndicator())

Regards,

Benoit.
Reply With Quote
  (#7 (permalink)) Old
Member
 
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Sep 2009
Default 09-10-2009, 07:17 AM

yes.. I am calling that in preWindowOpen(...) as

configurer.setShowStatusLine(true);
and
configurer.setShowProgressIndicator(true);

Cheers
--Satya
Reply With Quote
  (#8 (permalink)) Old
Member
 
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Join Date: Aug 2009
Default 09-10-2009, 07:26 AM

Your progressRegion control is not associated with any LayoutData. May it be the not visible cause ?

Sorry, I don't have much idea right now.

Benoit.
Reply With Quote
Reply

Tags
eclipse, progressbar, rcp, statusbar

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Eclipse RCP and Swing customized components kamatam Eclipse 1 04-25-2009 04:50 AM
Using the eclipse welcome page instead of a customized intro page alterswede Eclipse 0 11-11-2008 12:37 PM


Copyright 1997-2009, DZone, Inc.
vBulletin Skin developed by: vBStyles.com