Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-04-18 08:29:18 -0400
committeratikhomirov2007-04-18 08:29:18 -0400
commitfb2a0bc405679c64d8fcf464b078033b1d6d107a (patch)
tree18193140469746d5b748bb0e871cee6c7a48f786
parent4392908ff5af953c5cfea112d5e85c3dc935a423 (diff)
downloadorg.eclipse.gmf-tooling-fb2a0bc405679c64d8fcf464b078033b1d6d107a.tar.gz
org.eclipse.gmf-tooling-fb2a0bc405679c64d8fcf464b078033b1d6d107a.tar.xz
org.eclipse.gmf-tooling-fb2a0bc405679c64d8fcf464b078033b1d6d107a.zip
overriding method to pass constant value is not a good approach
-rw-r--r--plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/GenModelConfigurationPage.java9
-rw-r--r--plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/MapModelConfigurationPage.java9
-rw-r--r--plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFGraphSimpleModelWizard.java9
-rw-r--r--plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFToolSimpleModelWizard.java14
-rw-r--r--plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/pages/simple/DomainModelSelectionPage.java8
5 files changed, 11 insertions, 38 deletions
diff --git a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/GenModelConfigurationPage.java b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/GenModelConfigurationPage.java
index 495e12ed2..e3417b2e4 100644
--- a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/GenModelConfigurationPage.java
+++ b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/GenModelConfigurationPage.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Borland Software Corporation
+ * Copyright (c) 2006, 2007 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -46,8 +46,6 @@ import org.eclipse.ui.PlatformUI;
class GenModelConfigurationPage extends ModelConfigurationPage {
private static final String FILE_EXT_ECORE = "ecore"; //$NON-NLS-1$
- private static final String FILE_EXT_GENMODEL = "genmodel"; //$NON-NLS-1$
-
private Button createWizardBtn;
private Button createDefaultBtn;
private Button refreshStaleBtn;
@@ -56,10 +54,7 @@ class GenModelConfigurationPage extends ModelConfigurationPage {
super(pageId, rlp, resourceSet);
setTitle(Messages.TransformToGenModelWizard_title_genmodel);
setDescription(Messages.TransformToGenModelWizard_descr_genmodel);
- }
-
- protected String getModelFileExtension() {
- return FILE_EXT_GENMODEL;
+ setModelFileExtension("genmodel"); //$NON-NLS-1$
}
@Override
diff --git a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/MapModelConfigurationPage.java b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/MapModelConfigurationPage.java
index ef85900c9..b262816a5 100644
--- a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/MapModelConfigurationPage.java
+++ b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/transform/MapModelConfigurationPage.java
@@ -1,5 +1,5 @@
/**
- * Copyright (c) 2006 Borland Software Corporation
+ * Copyright (c) 2006, 2007 Borland Software Corporation
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -23,18 +23,13 @@ import org.eclipse.gmf.mappings.Mapping;
class MapModelConfigurationPage extends ModelConfigurationPage {
- private static final String FILE_EXT_GMFMAP = "gmfmap"; //$NON-NLS-1$
-
MapModelConfigurationPage(String pageId, ResourceLocationProvider rlp, ResourceSet resourceSet) {
super(pageId, rlp, resourceSet);
setTitle(Messages.TransformToGenModelWizard_title_mapmodel);
setDescription(Messages.TransformToGenModelWizard_descr_mapmodel);
+ setModelFileExtension("gmfmap"); //$NON-NLS-1$
}
- protected String getModelFileExtension() {
- return FILE_EXT_GMFMAP;
- }
-
@Override
protected Resource doLoadResource(IProgressMonitor monitor) throws CoreException {
TransformToGenModelOperation o = getOperation();
diff --git a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFGraphSimpleModelWizard.java b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFGraphSimpleModelWizard.java
index 74527dd0c..bc1d28bb2 100644
--- a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFGraphSimpleModelWizard.java
+++ b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFGraphSimpleModelWizard.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006, 2007 Borland Software Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -99,12 +99,7 @@ public class GMFGraphSimpleModelWizard extends GMFGraphModelWizard {
ResourceLocationProvider rloc = new ResourceLocationProvider(selection);
ResourceSet resourceSet = new ResourceSetImpl();
if (mode.detectReconcile(rloc)) {
- graphicalModelSelectionPage = new ModelSelectionPage("GraphicalModelSelectionPage", rloc, resourceSet) { //$NON-NLS-1$
-
- protected String getModelFileExtension() {
- return "gmfgraph"; //$NON-NLS-1$
- }
- };
+ graphicalModelSelectionPage = new ModelSelectionPage("GraphicalModelSelectionPage", rloc, resourceSet, "gmfgraph"); //$NON-NLS-1$ //$NON-NLS-2$
graphicalModelSelectionPage.setPageComplete(false);
graphicalModelSelectionPage.setModelRequired(true);
graphicalModelSelectionPage.setTitle(Messages.SimpleModelWizardGraphModelSelectionPageTitle);
diff --git a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFToolSimpleModelWizard.java b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFToolSimpleModelWizard.java
index 5453bc761..b1eda9c60 100644
--- a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFToolSimpleModelWizard.java
+++ b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/GMFToolSimpleModelWizard.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006, 2007 Borland Software Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -11,8 +11,6 @@
*/
package org.eclipse.gmf.internal.bridge.wizards;
-import java.util.List;
-
import org.eclipse.core.resources.IFile;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
@@ -79,10 +77,9 @@ public class GMFToolSimpleModelWizard extends GMFToolModelWizard {
return builder.process(toolingDefinitionPage.getModel());
}
- @SuppressWarnings("unchecked")
protected void reconcileModel() {
ToolRegistry existingToolRegistry = null;
- for (EObject element : (List<? extends EObject>) toolingModelSelectionPage.getResource().getContents()) {
+ for (EObject element : toolingModelSelectionPage.getResource().getContents()) {
if (element instanceof ToolRegistry) {
existingToolRegistry = (ToolRegistry) element;
break;
@@ -99,12 +96,7 @@ public class GMFToolSimpleModelWizard extends GMFToolModelWizard {
ResourceLocationProvider rloc = new ResourceLocationProvider(selection);
ResourceSet resourceSet = new ResourceSetImpl();
if (mode.detectReconcile(rloc)) {
- toolingModelSelectionPage = new ModelSelectionPage("ToolingModelSelectionPage", rloc, resourceSet) { //$NON-NLS-1$
-
- protected String getModelFileExtension() {
- return "gmftool"; //$NON-NLS-1$
- }
- };
+ toolingModelSelectionPage = new ModelSelectionPage("ToolingModelSelectionPage", rloc, resourceSet, "gmftool"); //$NON-NLS-1$ //$NON-NLS-2$
toolingModelSelectionPage.setPageComplete(false);
toolingModelSelectionPage.setModelRequired(true);
toolingModelSelectionPage.setTitle(Messages.SimpleModelWizardToolModelSelectionPageTitle);
diff --git a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/pages/simple/DomainModelSelectionPage.java b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/pages/simple/DomainModelSelectionPage.java
index 231eccad8..363177af2 100644
--- a/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/pages/simple/DomainModelSelectionPage.java
+++ b/plugins/org.eclipse.gmf.bridge.ui/src/org/eclipse/gmf/internal/bridge/wizards/pages/simple/DomainModelSelectionPage.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2006 Eclipse.org
+ * Copyright (c) 2006, 2007 Borland Software Corp.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -30,11 +30,7 @@ public class DomainModelSelectionPage extends ExtensibleModelSelectionPage imple
private EPackage contents;
public DomainModelSelectionPage(String pageId, ResourceLocationProvider rloc, ResourceSet resourceSet) {
- super(pageId, rloc, resourceSet);
- }
-
- protected String getModelFileExtension() {
- return "ecore"; //$NON-NLS-1$
+ super(pageId, rloc, resourceSet, "ecore"); //$NON-NLS-1$
}
protected void addExtensions() {

Back to the top