Java Reference
In-Depth Information
Launching again to test our new action and dialog, we find that it works as
desired, as shown in Figure 10-56. We are able to enter a new hyperlink value
using the menu item, which marks the diagram as dirty, as we expect. A double-
click of the node opens our Web browser to the specified address.
Figure 10-56
Hyperlink dialog
10.9.4 Custom Decorator
Continuing our tour of runtime extensibility, we now look at how to add a dec-
orator to our event node to indicate to the Practitioner whether a hyperlink has
been added. Currently, a double-click of an event does nothing if no hyperlink
has been set, but there's no way to know that one has been set by looking at the
diagram. We want a small decorator near the node that indicates that it has a
hyperlink set. We can use the decorator service in our customization plug-in to
accomplish the task. To begin, we contribute the following extension to our
plugin.xml file:
<extension
point="org.eclipse.gmf.runtime.diagram.ui.decoratorProviders">
<decoratorProvider
class="org.eclipse.scenario.diagram.custom.providers.
LinkDecoratorProvider">
<Priority name="Lowest"/>
</decoratorProvider>
</extension>
Search WWH ::




Custom Search