SimpleIDE Menus and Navigator Control [message #893547] |
Wed, 04 July 2012 10:03  |
Eclipse User |
|
|
|
Hi
after finally getting SimpleIDE working, I discovered, that on each start of IDE, new "Themes" menu gets created, and new Navigator Control. those get persisted into workbench.xmi and on next start, first instance of menu is loaded from xmi file, next one will be created manually. if you start IDE 10 times, you get 10 Menu items "Themes"
with Menu I was able to solve it with simple patch in ThemeMenuProcessor.java
List<MMenuElement> items = menu.getChildren();
boolean found = false;
for (MMenuElement mMenuElement : items) {
if ("Themes".equals(mMenuElement.getLabel())) {
found = true;
break;
}
}
if(found == false) {
menu.getChildren().add(themesMenu);
}
now the question, more general. what is correct way of doing this? some kind of control, if the menu is already instantiated? or how?
is there in API some easier way to find Menu Item according to Text / ID ?
thanks a lot in advance
Marek
Addendum:
I found out, that those things are propagated to the UI using fragments, but still there remains the question, why are those parts (Navigator, Outline, ...) displayed many times, or why are they actually always newly instantiated.
[Updated on: Wed, 04 July 2012 10:49] by Moderator
|
|
|
Re: SimpleIDE Menus and Navigator Control [message #893574 is a reply to message #893547] |
Wed, 04 July 2012 12:09   |
Eclipse User |
|
|
|
Hi,
somehow the term ressource deltas appears in my mind.
This means, if you start with the -clean argument that problem should be
done
Am 04.07.2012 16:03, schrieb Marek Jasovsky:
> Hi
>
> after finally getting SimpleIDE working, I discovered, that on each
> start of IDE, new "Themes" menu gets created, and new Navigator Control.
> those get persisted into workbench.xmi and on next start, first instance
> of menu is loaded from xmi file, next one will be created manually. if
> you start IDE 10 times, you get 10 Menu items "Themes"
>
> with Menu I was able to solve it with simple patch in
> ThemeMenuProcessor.java
>
> List<MMenuElement> items = menu.getChildren();
> boolean found = false;
> for (MMenuElement mMenuElement : items) {
> if ("Themes".equals(mMenuElement.getLabel())) {
> found = true;
> break;
> }
> }
>
> if(found == false) {
> menu.getChildren().add(themesMenu);
> }
|
|
|
|
|
|
Re: SimpleIDE Menus and Navigator Control [message #894041 is a reply to message #893574] |
Fri, 06 July 2012 09:22   |
Eclipse User |
|
|
|
Yes when the SimpleIDE stuff was developed there was no need to check if
a contribution was there already because we used deltas for restoring
the state. This was changed but the SimpleIDE code was not updated to it.
Tom
Am 04.07.12 18:09, schrieb Oliver Koch:
> Hi,
>
> somehow the term ressource deltas appears in my mind.
>
> This means, if you start with the -clean argument that problem should be
> done
>
> Am 04.07.2012 16:03, schrieb Marek Jasovsky:
>> Hi
>>
>> after finally getting SimpleIDE working, I discovered, that on each
>> start of IDE, new "Themes" menu gets created, and new Navigator Control.
>> those get persisted into workbench.xmi and on next start, first instance
>> of menu is loaded from xmi file, next one will be created manually. if
>> you start IDE 10 times, you get 10 Menu items "Themes"
>>
>> with Menu I was able to solve it with simple patch in
>> ThemeMenuProcessor.java
>>
>> List<MMenuElement> items = menu.getChildren();
>> boolean found = false;
>> for (MMenuElement mMenuElement : items) {
>> if ("Themes".equals(mMenuElement.getLabel())) {
>> found = true;
>> break;
>> }
>> }
>>
>> if(found == false) {
>> menu.getChildren().add(themesMenu);
>> }
>
>
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05870 seconds