Skip to main content



      Home
Home » Modeling » TMF (Xtext) » Example Outline View Filter Question
Example Outline View Filter Question [message #53942] Mon, 29 June 2009 07:53 Go to next message
Eclipse UserFriend
I'm going through the outline view filtering example from the Xtext
documentation.

Regarding the example FilterFooAction class (see below):
- where does the "Activator" come from in the lines
setImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
setDisabledImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
?

I can't find any Activator class with the getImageDescriptor method in my
workspace.

There is an Activator org.eclipse.xtext.ui.core.internal.Activator
with an imageDescriptorFromPlugin method. I guess this should this be used
instead?

I'm using the 0.7.0.v200906222230 version of Xtext.


------------------------------------------------------------ -----------
public class FilterFooAction extends AbstractFilterAction {

public FilterFooAction(XtextContentOutlinePage outlinePage) {
super("Filter Foo", outlinePage);
setToolTipText("Show / hide foo");
setDescription("Show / hide foo");
setImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));

setDisabledImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
}

@Override
protected String getToggleId() {
return "FilterFooAction.isChecked";
}

@Override
protected ViewerFilter createFilter() {
return new FooOutlineFilter();
}

}
Re: Example Outline View Filter Question [message #54044 is a reply to message #53942] Mon, 29 June 2009 09:49 Go to previous message
Eclipse UserFriend
Hi Porter,

this snippet makes the assumption that you have something like

public static ImageDescriptor getImageDescriptor(String path) {
return imageDescriptorFromPlugin(PLUGIN_ID, path);
}

in your ConcreteMyDslActivator (extends MyDslActivator).
It the ConcreteMyDslActivator does not exist, you have to create it on
your own in your UI plugin (and change the Manifest.MF accordingly).
The alternative is to use #imageDescriptorFromPlugin(String, String)
directly.

Thanks for the hint, we'll fix the docs as soon as possible.

Regards,
Sebastian


Am 29.06.2009 13:53 Uhr, schrieb Porter:
> I'm going through the outline view filtering example from the Xtext
> documentation.
>
> Regarding the example FilterFooAction class (see below):
> - where does the "Activator" come from in the lines
> setImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
> setDisabledImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
> ?
>
> I can't find any Activator class with the getImageDescriptor method in
> my workspace.
>
> There is an Activator org.eclipse.xtext.ui.core.internal.Activator
> with an imageDescriptorFromPlugin method. I guess this should this be
> used instead?
>
> I'm using the 0.7.0.v200906222230 version of Xtext.
>
>
> ------------------------------------------------------------ -----------
> public class FilterFooAction extends AbstractFilterAction {
>
> public FilterFooAction(XtextContentOutlinePage outlinePage) {
> super("Filter Foo", outlinePage);
> setToolTipText("Show / hide foo");
> setDescription("Show / hide foo");
> setImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
> setDisabledImageDescriptor(Activator.getImageDescriptor("icons/foo.gif "));
> }
>
> @Override
> protected String getToggleId() {
> return "FilterFooAction.isChecked";
> }
>
> @Override
> protected ViewerFilter createFilter() {
> return new FooOutlineFilter();
> }
>
> }
>
Previous Topic:Suggestion - custom post processing
Next Topic:Can I create GPL + DSL by XTEXT
Goto Forum:
  


Current Time: Fri Mar 14 01:26:10 EDT 2025

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

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

Back to the top