Skip to main content



      Home
Home » Modeling » UML2 Tools » Reuse UML New Diagram wizards
Reuse UML New Diagram wizards [message #474690] Wed, 16 July 2008 22:19 Go to next message
Eclipse UserFriend
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 06:58 Go to previous messageGo to next message
Eclipse UserFriend
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 12:09 Go to previous messageGo to next message
Eclipse UserFriend
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 14:58 Go to previous messageGo to next message
Eclipse UserFriend
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 17:22 Go to previous messageGo to next message
Eclipse UserFriend
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 12:20 Go to previous message
Eclipse UserFriend
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 06:58 Go to previous message
Eclipse UserFriend
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 12:09 Go to previous message
Eclipse UserFriend
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 14:58 Go to previous message
Eclipse UserFriend
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 17:22 Go to previous message
Eclipse UserFriend
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 12:20 Go to previous message
Eclipse UserFriend
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: Thu Jul 10 02:05:49 EDT 2025

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

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

Back to the top