Author: rob.stryker(a)jboss.com
Date: 2011-10-13 07:27:32 -0400 (Thu, 13 Oct 2011)
New Revision: 35614
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
Log:
JBIDE-9793 - ensuring events are fired at correct time
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java 2011-10-13
11:12:52 UTC (rev 35613)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/AdapterWizardPageModel.java 2011-10-13
11:27:32 UTC (rev 35614)
@@ -47,7 +47,6 @@
}
public void setRepositoryPath(String repositoryPath) {
- firePropertyChange(PROPERTY_REPO_PATH, this.repositoryPath, this.repositoryPath =
repositoryPath);
wizardModel.setCloneDirectory(repositoryPath);
}
@@ -66,7 +65,6 @@
}
public void setRemoteName(String remoteName) {
- firePropertyChange(PROPERTY_REMOTE_NAME, this.remoteName, this.remoteName =
remoteName);
wizardModel.setRemoteName(remoteName);
}
@@ -74,8 +72,7 @@
setRemoteName(REMOTE_NAME_DEFAULT);
}
- // TODO is this the best way? Or should we expose ONLY getters to the parent
- // model?
+ // TODO should this stay?
public ImportProjectWizardModel getParentModel() {
return wizardModel;
}
Modified:
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java
===================================================================
---
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13
11:12:52 UTC (rev 35613)
+++
trunk/as/plugins/org.jboss.tools.openshift.express.ui/src/org/jboss/tools/openshift/express/internal/ui/wizard/ImportProjectWizardModel.java 2011-10-13
11:27:32 UTC (rev 35614)
@@ -59,7 +59,9 @@
private static final String CLONE_DIR = "cloneDir";
public void setProperty(String key, Object value) {
+ Object oldVal = dataModel.get(key);
dataModel.put(key, value);
+ firePropertyChange(key, oldVal, value);
}
public Object getProperty(String key) {
@@ -67,37 +69,37 @@
}
public void setUser(IUser user) {
- dataModel.put(USER, user);
+ setProperty(USER, user);
}
public IUser getUser() {
- return (IUser) dataModel.get(USER);
+ return (IUser)getProperty(USER);
}
public IApplication getApplication() {
- return (IApplication) dataModel.get(APPLICATION);
+ return (IApplication) getProperty(APPLICATION);
}
+ public void setApplication(IApplication application) {
+ setProperty(APPLICATION, application);
+ }
+
public void setRemoteName(String remoteName) {
- dataModel.put(REMOTE_NAME, remoteName);
+ setProperty(REMOTE_NAME, remoteName);
}
public String getRemoteName() {
- return (String) dataModel.get(REMOTE_NAME);
+ return (String) getProperty(REMOTE_NAME);
}
public void setCloneDirectory(String cloneDir) {
- dataModel.put(CLONE_DIR, cloneDir);
+ setProperty(CLONE_DIR, cloneDir);
}
public String getCloneDirectory() {
- return (String) dataModel.get(CLONE_DIR);
+ return (String) getProperty(CLONE_DIR);
}
- public void setApplication(IApplication application) {
- dataModel.put(APPLICATION, application);
- }
-
public void importProject(final File projectFolder, IProgressMonitor monitor) throws
OpenshiftException,
CoreException,
InterruptedException {
Show replies by date