Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 Tools » Reuse UML New Diagram wizards
Reuse UML New Diagram wizards [message #474690] Thu, 17 July 2008 02:19 Go to next message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Hello,

How can I call a UMLCreationWizard to create new diagrams on my RCP
application?

I've put the code:

UMLCreationWizard wizard = new UMLCreationWizard();
WizardDialog dialog = new WizardDialog(wizard.getShell(), wizard);
dialog.open();

But it didn't work.

Thanks in advance,

Nogueira.
Re: Reuse UML New Diagram wizards [message #474691 is a reply to message #474690] Thu, 17 July 2008 10:58 Go to previous messageGo to next message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Nogueira,

I created a test with the code you produced. NPE is thrown:
java.lang.NullPointerException
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.initialPopu lateContainerNameField(WizardNewFileCreationPage.java:568)
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.createContr ol(WizardNewFileCreationPage.java:216)
at org.eclipse.uml2.diagram.clazz.part.UMLCreationWizardPage.cr eateControl(UMLCreationWizardPage.java:65)
....
Do you have the same excection in your log?

If yes, the problem is that wizard should be initialized:
UMLCreationWizard wizard = new UMLCreationWizard();
// init wizard
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
WizardDialog dialog = new WizardDialog(wizard.getShell(), wizard);
dialog.open();

The second paramer (selection) is used to calculate parentPath. In my example
it's empty, but it should be filled with IResource. See WizardNewFileCreationPage#initialPopulateContainerNameField( )
for details.

Best wishes,
Tatiana.

> Hello,
>
> How can I call a UMLCreationWizard to create new diagrams on my RCP
> application?
>
> I've put the code:
>
> UMLCreationWizard wizard = new UMLCreationWizard();
> WizardDialog dialog = new WizardDialog(wizard.getShell(), wizard);
> dialog.open();
> But it didn't work.
>
> Thanks in advance,
>
> Nogueira.
>
Re: Reuse UML New Diagram wizards [message #474692 is a reply to message #474691] Thu, 17 July 2008 16:09 Go to previous messageGo to next message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Tatiana,

Thank you so much!!!!!! The wizard was created successfuly :D


No, there is no exception in my log. The wizard just didn't appear.
But the "init" method works fine! :)

Thank you again!

P.S.: Are you brazilian? If yes, could you give me your e-mail (msn or
google talk) to keep contact?

Best regards,

Nogueira.
Re: Reuse UML New Diagram wizards [message #474693 is a reply to message #474691] Fri, 18 July 2008 18:58 Go to previous messageGo to next message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
One more question...

In my RCP application, when I select a wizard to create a new diagram,
it's needed to select the parent folder where will be created the file.
But the names of the project folders and its subdirectories are invisible
to me.
It's possible to select a folder, but in blinding. In the new file wizard
is shown the tree items ('+' to expand the tree) but any title is visible.

How to solve it?

Thank you in advance,

Best regards,

Nogueira.
Re: Reuse UML New Diagram wizards [message #474699 is a reply to message #474693] Tue, 22 July 2008 21:22 Go to previous messageGo to next message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Any ideias? =/


Nogueira wrote:

> One more question...

> In my RCP application, when I select a wizard to create a new diagram,
> it's needed to select the parent folder where will be created the file.
> But the names of the project folders and its subdirectories are invisible
> to me.
> It's possible to select a folder, but in blinding. In the new file wizard
> is shown the tree items ('+' to expand the tree) but any title is visible.

> How to solve it?

> Thank you in advance,

> Best regards,

> Nogueira.
Re: Reuse UML New Diagram wizards [message #474927 is a reply to message #474699] Wed, 23 July 2008 16:20 Go to previous message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Solved!

Just put the code below in method 'initialize(IWorkbenchConfigurer
configurer)' from class 'ApplicationWorkbenchAdvisor':

WorkbenchAdapterBuilder.registerAdapters();
Re: Reuse UML New Diagram wizards [message #621271 is a reply to message #474690] Thu, 17 July 2008 10:58 Go to previous message
Tatiana Fesenko is currently offline Tatiana Fesenko
Messages: 530
Registered: July 2009
Senior Member
Hello Nogueira,

I created a test with the code you produced. NPE is thrown:
java.lang.NullPointerException
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.initialPopu lateContainerNameField(WizardNewFileCreationPage.java:568)
at org.eclipse.ui.dialogs.WizardNewFileCreationPage.createContr ol(WizardNewFileCreationPage.java:216)
at org.eclipse.uml2.diagram.clazz.part.UMLCreationWizardPage.cr eateControl(UMLCreationWizardPage.java:65)
....
Do you have the same excection in your log?

If yes, the problem is that wizard should be initialized:
UMLCreationWizard wizard = new UMLCreationWizard();
// init wizard
wizard.init(PlatformUI.getWorkbench(), new StructuredSelection());
WizardDialog dialog = new WizardDialog(wizard.getShell(), wizard);
dialog.open();

The second paramer (selection) is used to calculate parentPath. In my example
it's empty, but it should be filled with IResource. See WizardNewFileCreationPage#initialPopulateContainerNameField( )
for details.

Best wishes,
Tatiana.

> Hello,
>
> How can I call a UMLCreationWizard to create new diagrams on my RCP
> application?
>
> I've put the code:
>
> UMLCreationWizard wizard = new UMLCreationWizard();
> WizardDialog dialog = new WizardDialog(wizard.getShell(), wizard);
> dialog.open();
> But it didn't work.
>
> Thanks in advance,
>
> Nogueira.
>
Re: Reuse UML New Diagram wizards [message #621274 is a reply to message #474691] Thu, 17 July 2008 16:09 Go to previous message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Tatiana,

Thank you so much!!!!!! The wizard was created successfuly :D


No, there is no exception in my log. The wizard just didn't appear.
But the "init" method works fine! :)

Thank you again!

P.S.: Are you brazilian? If yes, could you give me your e-mail (msn or
google talk) to keep contact?

Best regards,

Nogueira.
Re: Reuse UML New Diagram wizards [message #621275 is a reply to message #474691] Fri, 18 July 2008 18:58 Go to previous message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
One more question...

In my RCP application, when I select a wizard to create a new diagram,
it's needed to select the parent folder where will be created the file.
But the names of the project folders and its subdirectories are invisible
to me.
It's possible to select a folder, but in blinding. In the new file wizard
is shown the tree items ('+' to expand the tree) but any title is visible.

How to solve it?

Thank you in advance,

Best regards,

Nogueira.
Re: Reuse UML New Diagram wizards [message #621713 is a reply to message #474693] Tue, 22 July 2008 21:22 Go to previous message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Any ideias? =/


Nogueira wrote:

> One more question...

> In my RCP application, when I select a wizard to create a new diagram,
> it's needed to select the parent folder where will be created the file.
> But the names of the project folders and its subdirectories are invisible
> to me.
> It's possible to select a folder, but in blinding. In the new file wizard
> is shown the tree items ('+' to expand the tree) but any title is visible.

> How to solve it?

> Thank you in advance,

> Best regards,

> Nogueira.
Re: Reuse UML New Diagram wizards [message #621730 is a reply to message #474699] Wed, 23 July 2008 16:20 Go to previous message
Leandro is currently offline Leandro
Messages: 20
Registered: July 2009
Junior Member
Solved!

Just put the code below in method 'initialize(IWorkbenchConfigurer
configurer)' from class 'ApplicationWorkbenchAdvisor':

WorkbenchAdapterBuilder.registerAdapters();
Previous Topic:Assocation and subpackage
Next Topic:Multiplicities and names in an Association
Goto Forum:
  


Current Time: Tue Sep 02 21:15:38 GMT 2014

Powered by FUDForum. Page generated in 0.03632 seconds