Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » import xml files
import xml files [message #222185] Sat, 21 March 2009 15:41 Go to next message
Filip Sebesta is currently offline Filip SebestaFriend
Messages: 26
Registered: July 2009
Junior Member
I want to import xml files from one commercial application into my gmf
model. I have made XSLT transformation which transform xml of the
application output into xml structure of my gmf meta model, but I don't
know where I can apply this transformation in my gmf application and how
to do this through import button in my application menu.

Secondly, I have got nodes which contain tickets, and I want to notify
node in case a ticket was changed. It is possible to use ENotification and
how?
Re: import xml files [message #222194 is a reply to message #222185] Sat, 21 March 2009 16:35 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

Hello Filip!

> I want to import xml files from one commercial application into my gmf
> model. I have made XSLT transformation which transform xml of the
> application output into xml structure of my gmf meta model, but I don't
> know where I can apply this transformation in my gmf application and how
> to do this through import button in my application menu.
You have to make your own Import-Wizard.
Extension Point: org.eclipse.ui.importWizards
http://help.eclipse.org/stable/index.jsp?topic=/org.eclipse. platform.doc.isv/guide/dialogs_wizards_importWizards.htm

> Secondly, I have got nodes which contain tickets, and I want to notify
> node in case a ticket was changed. It is possible to use ENotification
> and how?
In the genmodel-file go to your node and there should be a reference to
ticket. Set the Notify-Property of this reference to "true". Then
implement handleNotificationEvent in the EditPart of the node and catch
event when ticket is changed.

Best wishes
Julia
Re: import xml files [message #222224 is a reply to message #222194] Sun, 22 March 2009 10:21 Go to previous messageGo to next message
Filip Sebesta is currently offline Filip SebestaFriend
Messages: 26
Registered: July 2009
Junior Member
Thanks!

I have done all you have mentioned, but I'm still not able to catch a
notification from a ticket.


I have made testing method in my NodeEditPart:

protected void handleNotificationEvent(Notification notification) {


if (notification.getNotifier() instanceof Ticket) {
System.out.println("Catched");
}

super.handleNotificationEvent(notification);
}

What is wrong?
Re: import xml files [message #222283 is a reply to message #222224] Sun, 22 March 2009 21:37 Go to previous message
Eclipse UserFriend
Originally posted by: cayla_sha.gmx.net

*ahem* I`m sorry... I didn`t read your mail very carefully...
With the change in the genmodel I told you, you can catch events when
ticket is added or removed from node.

Additionally to the handleNotificationEvent-method add this to the
EditPart of the node:
/**
* @generated NOT
*/
@Override
protected void addNotationalListeners()
{
Diagram diagram = this.getDiagramView();
if (diagram != null)
{
addListenerFilter("NodeListensToTicketChange", this, diagram,
EditorPackage.Literals.TICKET_TICKETATTRIBUTE);
}

super.addNotationalListeners();
}
/**
* @generated NOT
*/
@Override
protected void removeNotationalListeners()
{
removeListenerFilter("NodeListensToTicketChange");
super.removeNotationalListeners();
}

At the place "TICKET_TICKETATTRIBUTE" you have to chose the attribute to
which you want to listen.

And then you can catch the event in the handleNotificationEvent-method
with this:
Object feature = notification.getFeature();
if(EditorPackage.Literals.TICKET_TICKETATTRIBUTE.equals(feat ure))
{
System.out.println("Catched");
}

Hope this works
Best wishes
Julia


Filip Sebesta schrieb:
> Thanks!
>
> I have done all you have mentioned, but I'm still not able to catch a
> notification from a ticket.
>
>
> I have made testing method in my NodeEditPart:
>
> protected void handleNotificationEvent(Notification notification) {
>
>
> if (notification.getNotifier() instanceof Ticket) {
> System.out.println("Catched");
> }
>
> super.handleNotificationEvent(notification);
> }
>
> What is wrong?
>
Previous Topic:deleteFromModelAction remove="true" Not working [Please Help]
Next Topic:RCP App
Goto Forum:
  


Current Time: Tue Apr 16 17:01:27 GMT 2024

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

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

Back to the top