Migration to GMF 2.0.2 [message #182351] |
Thu, 10 April 2008 21:28 |
Eclipse User |
|
|
|
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 #182526 is a reply to message #182351] |
Fri, 11 April 2008 12:47 |
Eclipse User |
|
|
|
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;
}
|
|
|
Powered by
FUDForum. Page generated in 0.03268 seconds