Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoratikhomirov2007-04-18 08:29:17 -0400
committeratikhomirov2007-04-18 08:29:17 -0400
commit4392908ff5af953c5cfea112d5e85c3dc935a423 (patch)
tree33a78dbd20368534005ad184b2e8c81627dc414a
parent4a5cd91d8afdc330326a516daa82ccba20186818 (diff)
downloadorg.eclipse.gmf-tooling-4392908ff5af953c5cfea112d5e85c3dc935a423.tar.gz
org.eclipse.gmf-tooling-4392908ff5af953c5cfea112d5e85c3dc935a423.tar.xz
org.eclipse.gmf-tooling-4392908ff5af953c5cfea112d5e85c3dc935a423.zip
overriding method to pass constant value is not a good approach
-rw-r--r--plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ExtensibleModelSelectionPage.java8
-rw-r--r--plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ModelSelectionPage.java18
2 files changed, 22 insertions, 4 deletions
diff --git a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ExtensibleModelSelectionPage.java b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ExtensibleModelSelectionPage.java
index 68a3f1e9b..fa6b9160d 100644
--- a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ExtensibleModelSelectionPage.java
+++ b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ExtensibleModelSelectionPage.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
@@ -25,7 +25,11 @@ public class ExtensibleModelSelectionPage extends ModelSelectionPage {
private Map<String, ModelSelectionPageExtension> extensions; // id -> extension
public ExtensibleModelSelectionPage(String pageId, ResourceLocationProvider rloc, ResourceSet resourceSet) {
- super(pageId, rloc, resourceSet);
+ this(pageId, rloc, resourceSet, null);
+ }
+
+ public ExtensibleModelSelectionPage(String pageId, ResourceLocationProvider rloc, ResourceSet resourceSet, String modelFileExtension) {
+ super(pageId, rloc, resourceSet, modelFileExtension);
extensions = new LinkedHashMap<String, ModelSelectionPageExtension>();
addExtensions();
}
diff --git a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ModelSelectionPage.java b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ModelSelectionPage.java
index ba52000b3..a945f037c 100644
--- a/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ModelSelectionPage.java
+++ b/plugins/org.eclipse.gmf.common/src/org/eclipse/gmf/internal/common/ui/ModelSelectionPage.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
@@ -69,10 +69,17 @@ public class ModelSelectionPage extends WizardPage {
private boolean initialized;
+ private String modelFileExtension;
+
public ModelSelectionPage(String pageId, ResourceLocationProvider rloc, ResourceSet resourceSet) {
+ this(pageId, rloc, resourceSet, null);
+ }
+
+ public ModelSelectionPage(String pageId, ResourceLocationProvider rloc, ResourceSet resourceSet, String modelFileExtension) {
super(pageId);
this.rloc = rloc;
this.resourceSet = resourceSet;
+ setModelFileExtension(modelFileExtension);
}
protected ResourceSet getResourceSet() {
@@ -82,8 +89,15 @@ public class ModelSelectionPage extends WizardPage {
return resourceSet;
}
+ public void setModelFileExtension(String fileExtension) {
+ this.modelFileExtension = fileExtension;
+ }
+
+ /**
+ * @return <code>null</code> if none set
+ */
protected String getModelFileExtension() {
- return null;
+ return modelFileExtension;
}
public final void createControl(Composite parent) {

Back to the top