Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Migration to GMF 2.0.2
Migration to GMF 2.0.2 [message #182351] Thu, 10 April 2008 21:28 Go to next message
Eclipse UserFriend
Originally posted by: vlalan.csc.com

Hi All,

We are trying to migrate to GMF 2.0.2 from 2.0M3
For this we first migrated all the gmfmodels using the migrate to GMF 2.0
right click action, and then regenerated the code.
There are a number of changes that are found in the new generated code.

e.g. the arguments for createDiagram method for the diagram creation in
XXEditorUtil class has changed, the wizard for the diagram creation has
changed, and now the wizard asks for both the model and diagram file
location which was earlier a single page wizard

In our case we donot want to ask the users for the model file name and
location. I know that this can be done by commenting the code in addPages
method, but I want to know the correct method to suppress the model file
page during diagram creation.
Is there a way this can be achieved via gmfmodels like gmfmap or gmfgen ??

Also there are a number of structural changes which we are facing
(inheritance hierarchy for the generated class being changed)

Please if anyone could tell the docs that holds all the information for
the reasons behind these changes and the correct way to migrate to new
version

Thanks in advance,
Vipul
Re: Migration to GMF 2.0.2 [message #182461 is a reply to message #182351] Fri, 11 April 2008 11:15 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Vipul,

> For this we first migrated all the gmfmodels using the migrate to GMF
> 2.0 right click action, and then regenerated the code.
Well, this action was created to perform migration from GMF 1.0.* to GMF
2.0.* models.. So not sure if it is applicabel for 2.0M3-based models..

> model file page during diagram creation. Is there a way this can be
> achieved via gmfmodels like gmfmap or gmfgen ??
You can modify corresponding templates and generate your own wizard.

-----------------
Alex Shatalin
Re: Migration to GMF 2.0.2 [message #182526 is a reply to message #182351] Fri, 11 April 2008 12:47 Go to previous message
Eclipse UserFriend
Originally posted by: nospam.nospam.com

> the wizard asks for both the model and diagram file
> location which was earlier a single page wizard

Here's what I did to set the model file name to whatever the diagram file
name is set to on the first wizard page:

From XXXCreationWizardPage:

/**
* @generated NOT
*/
protected boolean validatePage() {
if (!super.validatePage()) {
return false;
}
String extension = getExtension();
if (extension != null
&& !getFilePath().toString().endsWith("." + extension)) {
setErrorMessage(NLS.bind(
Messages.XXXCreationWizardPageExtensionError,
extension));
return false;
}

// Set domain model file name to diagram model file name.
if (this.getNextPage() != null) {
if (this.getNextPage() instanceof XXXCreationWizardPage) {
XXXCreationWizardPage nextPage = (XXXCreationWizardPage) this
.getNextPage();
String nextPageFileName = this.getFileName().substring(
0,
this.getFileName().lastIndexOf(
"." + this.getExtension()));
nextPage.setFileName(XXXDiagramEditorUtil
.getUniqueFileName(this.getContainerFullPath(),
nextPageFileName, nextPage.getExtension()));
}
}
return true;
}
Previous Topic:Type Based Link
Next Topic:Custom view problem, into the GMF-RCP application
Goto Forum:
  


Current Time: Wed Apr 24 23:17:07 GMT 2024

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

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

Back to the top