Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Some toolbar items are missing when part size is too narrow
Some toolbar items are missing when part size is too narrow [message #494945] Tue, 03 November 2009 11:10 Go to next message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi all,

Using the following snippet I can reproduce problems with contribution
item when part is resized.

@Override
public void createPartControl(Composite parent)
{
parent.setLayout(GridLayoutFactory.fillDefaults().create());

final IToolBarManager toolbarManager = new ToolBarManager(SWT.FLAT |
SWT.WRAP | SWT.HORIZONTAL);

ToolBar toolbar = ((ToolBarManager)toolbarManager).createControl(parent);
toolbar.setLayoutData(GridDataFactory.swtDefaults().align(SW T.END,
SWT.TOP).grab(true, false).create());

toolbarManager.add(new Separator("dynamic"));
toolbarManager.add(new Separator("static"));

IAction action = new Action("Add")
{
@Override
public String getId(){return "action.add";}

@Override
public void run()
{
IContributionItem contributionItem = new ControlContribution("item" +
(++counter))
{
@Override
protected Control createControl(Composite parent)
{
parent.setLayout(GridLayoutFactory.fillDefaults().create());

Text text = new Text(parent,SWT.NONE);

text.setLayoutData(GridDataFactory.swtDefaults().align(SWT.B EGINNING,
SWT.CENTER).hint(SWT.DEFAULT, 16).create());

return text;
}
};

toolbarManager.appendToGroup("dynamic", contributionItem);
toolbarManager.update(true);
}
};
toolbarManager.appendToGroup("static", action);

action = new Action("Remove")
{
@Override
public String getId(){return "action.remove";}

@Override
public void run()
{
if (counter == 0) return;

toolbarManager.remove("item" + (counter--));
toolbarManager.update(true);
}
};
toolbarManager.appendToGroup("static", action);

toolbarManager.update(true);
}

Step to reproduce:

1. Add some contribution items (by clicking 'Add' action).
2. Resize part until it's not wide enough to display all the items.
3. At this point we can observe that some text boxes are missing.
4. When part is resized back, the missing text boxes are still missing.


Thanks & Regards,

Setya
Re: Some toolbar items are missing when part size is too narrow [message #495073 is a reply to message #494945] Tue, 03 November 2009 17:15 Go to previous messageGo to next message
Rüdiger Herrmann is currently offline Rüdiger HerrmannFriend
Messages: 581
Registered: July 2009
Senior Member
it looks like you found a bug. Please file a bugzilla so tahtwe can
track this issue.

Setya wrote:
> Hi all,
>
> Using the following snippet I can reproduce problems with contribution
> item when part is resized.
>
> @Override
> public void createPartControl(Composite parent)
> {
> parent.setLayout(GridLayoutFactory.fillDefaults().create());
>
> final IToolBarManager toolbarManager = new ToolBarManager(SWT.FLAT |
> SWT.WRAP | SWT.HORIZONTAL);
>
> ToolBar toolbar = ((ToolBarManager)toolbarManager).createControl(parent);
> toolbar.setLayoutData(GridDataFactory.swtDefaults().align(SW T.END,
> SWT.TOP).grab(true, false).create());
>
> toolbarManager.add(new Separator("dynamic"));
> toolbarManager.add(new Separator("static"));
>
> IAction action = new Action("Add")
> {
> @Override
> public String getId(){return "action.add";}
>
> @Override
> public void run()
> {
> IContributionItem contributionItem = new
> ControlContribution("item" + (++counter))
> {
> @Override
> protected Control createControl(Composite parent)
> {
>
> parent.setLayout(GridLayoutFactory.fillDefaults().create());
>
> Text text = new Text(parent,SWT.NONE);
>
> text.setLayoutData(GridDataFactory.swtDefaults().align(SWT.B EGINNING,
> SWT.CENTER).hint(SWT.DEFAULT, 16).create());
>
> return text;
> }
> };
>
> toolbarManager.appendToGroup("dynamic", contributionItem);
> toolbarManager.update(true);
> }
> };
> toolbarManager.appendToGroup("static", action);
>
> action = new Action("Remove")
> {
> @Override
> public String getId(){return "action.remove";}
>
> @Override
> public void run()
> {
> if (counter == 0) return;
>
> toolbarManager.remove("item" + (counter--));
> toolbarManager.update(true);
> }
> };
> toolbarManager.appendToGroup("static", action);
>
> toolbarManager.update(true);
> }
>
> Step to reproduce:
>
> 1. Add some contribution items (by clicking 'Add' action).
> 2. Resize part until it's not wide enough to display all the items.
> 3. At this point we can observe that some text boxes are missing.
> 4. When part is resized back, the missing text boxes are still missing.
>
>
> Thanks & Regards,
>
> Setya
Re: Some toolbar items are missing when part size is too narrow [message #495189 is a reply to message #495073] Wed, 04 November 2009 04:46 Go to previous message
Setya Nugdjaja is currently offline Setya NugdjajaFriend
Messages: 567
Registered: July 2009
Senior Member
Hi,

> it looks like you found a bug. Please file a bugzilla so tahtwe can
> track this issue.

Done. <a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=294155">Bug
294155.</a>


Regards,

Setya
Previous Topic:Missing WidgetAdapterFacttory
Next Topic:How is rap code synced with the platform's code?
Goto Forum:
  


Current Time: Wed Sep 18 22:22:05 GMT 2024

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

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

Back to the top