Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sprint task - refactoring and fix for issue http://bugs.eclipse.org/3…

  • Loading branch information...
commit beff0730a109246315955a9b1dc7b7a8028e3209 1 parent c918122
@MarkusTiede MarkusTiede authored
Showing with 267 additions and 384 deletions.
  1. +44 −181 org.eclipse.jubula.client.core/src/org/eclipse/jubula/client/core/events/DataEventDispatcher.java
  2. +14 −14 ...tor.ui/src/org/eclipse/jubula/client/inspector/ui/provider/sourceprovider/InspectableAutSourceProvider.java
  3. +23 −15 org.eclipse.jubula.client.teststyle/src/org/eclipse/jubula/client/teststyle/TeststyleHandler.java
  4. +20 −28 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/ChooseTestSuiteBP.java
  5. +9 −8 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/CompletenessBP.java
  6. +3 −2 ...eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/ComponentNameReuseBP.java
  7. +2 −2 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/ProblemsBP.java
  8. +34 −39 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/StartAutBP.java
  9. +19 −18 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/WorkingLanguageBP.java
  10. +4 −2 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/PMExceptionHandler.java
  11. +3 −3 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java
  12. +3 −1 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/CreateAutDefinitionHandler.java
  13. +7 −6 ...ipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/CreateNewProjectVersionHandler.java
  14. +5 −5 ...clipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/DeleteProjectHandler.java
  15. +7 −3 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/OpenProjectHandler.java
  16. +3 −1 ...lipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/RefreshProjectHandler.java
  17. +7 −5 ...clipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/SaveProjectAsHandler.java
  18. +3 −1 ...clipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/properties/ProjectGeneralPropertyPage.java
  19. +6 −4 ...e.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/ActiveProjectSourceProvider.java
  20. +24 −25 ...se.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/AvailableAutSourceProvider.java
  21. +6 −0 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/Utils.java
  22. +3 −4 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/AbstractJBTreeView.java
  23. +11 −10 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/RunningAutsView.java
  24. +3 −3 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/TestResultTreeView.java
  25. +4 −4 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/DataSetView.java
View
225 ...pse.jubula.client.core/src/org/eclipse/jubula/client/core/events/DataEventDispatcher.java
@@ -194,30 +194,6 @@ public void run(IProgressMonitor monitor) {
/**
*
- * to notify clients, that a project is created (new project, import project,
- * create new version, save project as)
- */
- public interface IProjectCreatedListener {
-
- /**
- * callback method
- */
- public void handleProjectCreated();
- }
-
- /**
- * to notify clients, that the project properties are modified
- */
- public interface IProjectPropertiesModifyListener {
- /**
- * callback method
- */
- public void handleProjectPropsChanged();
-
- }
-
- /**
- *
* to notify clients, that the connection to server is established
*/
public interface IServerConnectionListener {
@@ -294,13 +270,16 @@ public void run(IProgressMonitor monitor) {
*/
public void handleTestresultChanged(TestresultState state);
}
- /**to notify that project is opened */
- public interface IProjectOpenedListener {
+
+ /** to notify that project state has been changed */
+ public interface IProjectStateListener {
/**
+ * called if a project state has been changed
*
+ * @param state
+ * the new project state
*/
- public void handleProjectOpened();
-
+ public void handleProjectStateChanged(ProjectState state);
}
/**
@@ -374,6 +353,16 @@ public void run(IProgressMonitor monitor) {
notRunning
}
+ /** specifies the state of a project */
+ public enum ProjectState {
+ /** project has been opened */
+ opened,
+ /** project properties have been modified */
+ prop_modified,
+ /** project has been closed */
+ closed
+ }
+
/** listeners to observe button status of a dialog or wizard page */
private ListenerManager<IDialogStatusListener> m_dialogStatusListenerMgr =
new ListenerManager<IDialogStatusListener>();
@@ -451,38 +440,6 @@ public void run(IProgressMonitor monitor) {
new HashSet<IProjectLoadedListener>();
/**
- * <code>m_projectCreatedListeners</code>listener for creation of a project
- * (not available in database before)
- */
- private Set<IProjectCreatedListener> m_projectCreatedListeners =
- new HashSet<IProjectCreatedListener>();
-
- /**
- * <code>m_projectCreatedListenersPost</code> listener for a new project
- * POST-Event for gui updates
- */
- private Set<IProjectCreatedListener> m_projectCreatedListenersPost =
- new HashSet<IProjectCreatedListener>();
-
-
- /**
- * <code>m_projectPropertiesModifyListeners</code> listener for modification
- * of project properties
- */
- private Set<IProjectPropertiesModifyListener>
- m_projectPropertiesModifyListeners =
- new HashSet<IProjectPropertiesModifyListener>();
- /**
- * <code>m_projectPropertiesModifyListeners</code> listener for modification
- * of project properties
- * POST-Event for gui updates
- */
- private Set<IProjectPropertiesModifyListener>
- m_projectPropertiesModifyListenersPost =
- new HashSet<IProjectPropertiesModifyListener>();
-
-
- /**
* <code>m_autAgentConnectionListener</code>listener for state of server connection
*/
private Set<IServerConnectionListener> m_autAgentConnectionListener =
@@ -577,18 +534,18 @@ public void run(IProgressMonitor monitor) {
private Set<IProblemPropagationListener> m_problemPropagationListeners =
new HashSet<IProblemPropagationListener>();
- /** The IProjectOpenedListener */
- private Set<IProjectOpenedListener> m_projectOpenedListeners =
- new HashSet<IProjectOpenedListener>();
+ /** The IProjectStateListener */
+ private Set<IProjectStateListener> m_projectStateListeners =
+ new HashSet<IProjectStateListener>();
/**
* private constructor
*/
private DataEventDispatcher() {
-
// the DataEventDispatcher wrappes events from GeneralStorage
- GeneralStorage.getInstance().addReloadedSessListener(this);
- GeneralStorage.getInstance().addDataModifiedListener(this);
+ final GeneralStorage gs = GeneralStorage.getInstance();
+ gs.addReloadedSessListener(this);
+ gs.addDataModifiedListener(this);
}
/**
@@ -926,62 +883,13 @@ public void removeProjectLoadedListener(IProjectLoadedListener l) {
/**
* notify listener about loading of a project
*
- * @param monitor The progress monitor for this poperation.
+ * @param monitor The progress monitor for this operation.
*/
public void fireProjectLoadedListener(IProgressMonitor monitor) {
new LoadProjectDataOperation().run(monitor);
}
/**
- * @param l listener for new project
- * @param guiMode
- * should this listener be called after the model listener
- */
- public void addProjectCreatedListener(IProjectCreatedListener l,
- boolean guiMode) {
- if (guiMode) {
- m_projectCreatedListenersPost.add(l);
- } else {
- m_projectCreatedListeners.add(l);
- }
- }
-
- /**
- * @param l listener for reply to create a new project
- */
- public void removeProjectCreatedListener(IProjectCreatedListener l) {
- m_projectCreatedListeners.remove(l);
- m_projectCreatedListenersPost.remove(l);
- }
-
- /**
- * notify listener about loading of a project
- */
- public void fireProjectCreatedListener() {
- // model updates
- final Set<IProjectCreatedListener> stableListeners =
- new HashSet<IProjectCreatedListener>(m_projectCreatedListeners);
- for (IProjectCreatedListener l : stableListeners) {
- try {
- l.handleProjectCreated();
- } catch (Throwable t) {
- LOG.error(Messages.UnhandledExceptionWhileCallListeners, t);
- }
- }
-
- // gui updates
- final Set<IProjectCreatedListener> stableListenersPost =
- new HashSet<IProjectCreatedListener>(m_projectCreatedListenersPost);
- for (IProjectCreatedListener l : stableListenersPost) {
- try {
- l.handleProjectCreated();
- } catch (Throwable t) {
- LOG.error(Messages.UnhandledExceptionWhileCallListeners, t);
- }
- }
- }
-
- /**
* @param l listener for server connection state
* @param guiMode
* should this listener be called after the model listener
@@ -1086,58 +994,6 @@ public void fireAutServerConnectionChanged(ServerState state) {
}
/**
- *
- */
- public void fireProjectPropertiesModified() {
- // model updates
- final Set<IProjectPropertiesModifyListener> stableListeners =
- new HashSet<IProjectPropertiesModifyListener>(
- m_projectPropertiesModifyListeners);
- for (IProjectPropertiesModifyListener l : stableListeners) {
- try {
- l.handleProjectPropsChanged();
- } catch (Throwable t) {
- LOG.error(Messages.UnhandledExceptionWhileCallListeners, t);
- }
- }
-
- // gui updates
- final Set<IProjectPropertiesModifyListener> stableListenersPost =
- new HashSet<IProjectPropertiesModifyListener>(
- m_projectPropertiesModifyListenersPost);
- for (IProjectPropertiesModifyListener l : stableListenersPost) {
- try {
- l.handleProjectPropsChanged();
- } catch (Throwable t) {
- LOG.error(Messages.UnhandledExceptionWhileCallListeners, t);
- }
- }
- }
-
- /**
- * @param l listener for for reacting on changes in PropView or DataSetView
- * @param guiMode
- * should this listener be called after the model listener
- */
- public void addProjectPropertiesModifyListener(
- IProjectPropertiesModifyListener l, boolean guiMode) {
- if (guiMode) {
- m_projectPropertiesModifyListenersPost.add(l);
- } else {
- m_projectPropertiesModifyListeners.add(l);
- }
- }
-
- /**
- * @param l listener for modification of project properties
- */
- public void removeProjectPropertiesModifyListener(
- IProjectPropertiesModifyListener l) {
- m_projectPropertiesModifyListeners.remove(l);
- m_projectPropertiesModifyListenersPost.remove(l);
- }
-
- /**
* @param l listener for Record Mode state
* @param guiMode
* should this listener be called after the model listener
@@ -1432,14 +1288,18 @@ public void fireTestSuiteStateChanged(TestExecutionEvent event) {
}
/**
- * notify listeners that a project is opened
- */
- public void fireProjectOpenedListener() {
- final Set<IProjectOpenedListener> projectOpenedListeners =
- new HashSet<IProjectOpenedListener>(m_projectOpenedListeners);
- for (IProjectOpenedListener l : projectOpenedListeners) {
+ * notify listeners that the project state has changed
+ *
+ * @param state
+ * the new project state
+ */
+ public void fireProjectStateChanged(ProjectState state) {
+ final Set<IProjectStateListener> projectStateListeners =
+ new HashSet<IProjectStateListener>(
+ m_projectStateListeners);
+ for (IProjectStateListener l : projectStateListeners) {
try {
- l.handleProjectOpened();
+ l.handleProjectStateChanged(state);
} catch (Throwable t) {
LOG.error(Messages.UnhandledExceptionWhileCallListeners, t);
}
@@ -1447,16 +1307,19 @@ public void fireProjectOpenedListener() {
}
/**
- * @param l listener for project is opened
+ * @param l
+ * listener for project state changed events
*/
- public void addProjectOpenedListener(IProjectOpenedListener l) {
- m_projectOpenedListeners.add(l);
+ public void addProjectStateListener(IProjectStateListener l) {
+ m_projectStateListeners.add(l);
}
+
/**
- * @param l listener for project is opened
+ * @param l
+ * listener for project state changed events
*/
- public void removeProjectOpenedListener(IProjectOpenedListener l) {
- m_projectOpenedListeners.remove(l);
+ public void removeProjectStateListener(IProjectStateListener l) {
+ m_projectStateListeners.remove(l);
}
/**
View
28 ...ipse/jubula/client/inspector/ui/provider/sourceprovider/InspectableAutSourceProvider.java
@@ -21,7 +21,8 @@
import org.eclipse.jubula.client.core.agent.IAutRegistrationListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.model.IAUTMainPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
import org.eclipse.jubula.client.ui.rcp.sourceprovider.AbstractJBSourceProvider;
@@ -38,7 +39,7 @@
*/
public class InspectableAutSourceProvider extends AbstractJBSourceProvider
implements IAutRegistrationListener, IProjectLoadedListener,
- IProjectPropertiesModifyListener {
+ IProjectStateListener {
/**
* ID of variable that indicates which AUTs are currently running
@@ -50,9 +51,9 @@
* Constructor
*/
public InspectableAutSourceProvider() {
- DataEventDispatcher.getInstance().addProjectLoadedListener(this, true);
- DataEventDispatcher.getInstance().addProjectPropertiesModifyListener(
- this, true);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addProjectLoadedListener(this, true);
+ ded.addProjectStateListener(this);
AutAgentRegistration.getInstance().addListener(this);
}
@@ -60,9 +61,9 @@ public InspectableAutSourceProvider() {
* {@inheritDoc}
*/
public void dispose() {
- DataEventDispatcher.getInstance().removeProjectLoadedListener(this);
- DataEventDispatcher.getInstance().removeProjectPropertiesModifyListener(
- this);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.removeProjectLoadedListener(this);
+ ded.removeProjectStateListener(this);
AutAgentRegistration.getInstance().removeListener(this);
}
@@ -122,11 +123,10 @@ public void handleProjectLoaded() {
gdFireSourceChanged(ISources.WORKBENCH, getCurrentState());
}
- /**
- * {@inheritDoc}
- */
- public void handleProjectPropsChanged() {
- gdFireSourceChanged(ISources.WORKBENCH, getCurrentState());
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.prop_modified.equals(state)) {
+ gdFireSourceChanged(ISources.WORKBENCH, getCurrentState());
+ }
}
-
}
View
38 ...pse.jubula.client.teststyle/src/org/eclipse/jubula/client/teststyle/TeststyleHandler.java
@@ -20,7 +20,8 @@
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IDataChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IEventExecTestCasePO;
import org.eclipse.jubula.client.core.model.INodePO;
@@ -49,7 +50,7 @@
*
*/
public final class TeststyleHandler implements IDataChangedListener,
- IProjectLoadedListener, IProjectPropertiesModifyListener {
+ IProjectLoadedListener, IProjectStateListener {
/** singleton */
private static TeststyleHandler instance;
@@ -77,7 +78,7 @@ public static TeststyleHandler getInstance() {
*/
public void handleProjectLoaded() {
if (GeneralStorage.getInstance().getProject() == null) {
- return; // if theres no project, don't proceed
+ return; // if there is no project, don't proceed
}
ExtensionHelper.initCheckConfiguration();
checkEverything();
@@ -203,18 +204,18 @@ private void addTeststyleProblems() {
* Adds the handler to the important listeners.
*/
public void addToListener() {
- DataEventDispatcher eventDispatcher = DataEventDispatcher.getInstance();
- eventDispatcher.addDataChangedListener(this, true);
- eventDispatcher.addProjectPropertiesModifyListener(this, true);
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addDataChangedListener(this, true);
+ ded.addProjectStateListener(this);
}
/**
* Removes the handler to the important listeners.
*/
public void removeFromListener() {
- DataEventDispatcher eventDispatcher = DataEventDispatcher.getInstance();
- eventDispatcher.removeDataChangedListener(this);
- eventDispatcher.removeProjectPropertiesModifyListener(this);
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.removeDataChangedListener(this);
+ ded.removeProjectStateListener(this);
}
/**
@@ -260,11 +261,18 @@ public boolean isEnabled() {
return project.getProjectProperties().getCheckConfCont().getEnabled();
}
- /**
- * {@inheritDoc}
- */
- public void handleProjectPropsChanged() {
- checkEverything();
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ switch (state) {
+ case prop_modified:
+ checkEverything();
+ break;
+ case closed:
+ ProblemCont.getInstance().clear();
+ break;
+ case opened:
+ default:
+ break;
+ }
}
-
}
View
48 ...client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/ChooseTestSuiteBP.java
@@ -29,10 +29,11 @@
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ILanguageChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IOMStateListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IRecordModeStateListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ITestSuiteStateListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.OMState;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.RecordModeState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IPersistentObject;
@@ -108,12 +109,13 @@ public void handleLanguageChanged(Locale locale) {
/**
* <code>m_projPropModifyListener</code> listener for modification of project properties
*/
- private IProjectPropertiesModifyListener m_projPropModifyListener =
- new IProjectPropertiesModifyListener() {
-
- @SuppressWarnings("synthetic-access")
- public void handleProjectPropsChanged() {
- updateTestSuiteButtonState(true);
+ private IProjectStateListener m_projPropModifyListener =
+ new IProjectStateListener() {
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.prop_modified.equals(state)) {
+ updateTestSuiteButtonState(true);
+ }
}
};
@@ -121,9 +123,7 @@ public void handleProjectPropsChanged() {
private IProjectLoadedListener m_projLoadedListener =
new IProjectLoadedListener() {
- /**
- * {@inheritDoc}
- */
+ /** {@inheritDoc} */
@SuppressWarnings("synthetic-access")
public void handleProjectLoaded() {
m_isProjectLoaded = true;
@@ -418,24 +418,16 @@ private void validateNumberOfAvailableTestSuites() {
*
*/
private void init() {
- final DataEventDispatcher dataEventDispatcher =
- DataEventDispatcher.getInstance();
- dataEventDispatcher.addProjectLoadedListener(
- m_projLoadedListener, true);
- dataEventDispatcher.addDataChangedListener(
- m_currentProjDeletedListener, true);
- dataEventDispatcher.addAutStateListener(m_autStateListener, true);
- dataEventDispatcher.addLanguageChangedListener(m_langChangedListener,
- true);
- dataEventDispatcher.addProjectPropertiesModifyListener(
- m_projPropModifyListener, true);
- dataEventDispatcher.addTestSuiteStateListener(
- m_testSuiteStateListener, true);
- dataEventDispatcher.addOMStateListener(m_omStateListener, true);
- dataEventDispatcher.addRecordModeStateListener(
- m_recordModeStateListener, true);
- dataEventDispatcher.addDataChangedListener(
- m_dataChangedListener, true);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addProjectLoadedListener(m_projLoadedListener, true);
+ ded.addDataChangedListener(m_currentProjDeletedListener, true);
+ ded.addAutStateListener(m_autStateListener, true);
+ ded.addLanguageChangedListener(m_langChangedListener, true);
+ ded.addProjectStateListener(m_projPropModifyListener);
+ ded.addTestSuiteStateListener(m_testSuiteStateListener, true);
+ ded.addOMStateListener(m_omStateListener, true);
+ ded.addRecordModeStateListener(m_recordModeStateListener, true);
+ ded.addDataChangedListener(m_dataChangedListener, true);
}
/**
View
17 ...la.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/CompletenessBP.java
@@ -22,7 +22,8 @@
import org.eclipse.jubula.client.core.businessprocess.compcheck.CompletenessGuard;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ILanguageChangedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectOpenedListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.model.INodePO;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
@@ -39,7 +40,7 @@
* @author BREDEX GmbH
* @created 12.03.2007
*/
-public class CompletenessBP implements IProjectOpenedListener,
+public class CompletenessBP implements IProjectStateListener,
ILanguageChangedListener {
/** for log messages */
private static Logger log = LoggerFactory.getLogger(CompletenessBP.class);
@@ -53,7 +54,7 @@
private CompletenessBP() {
DataEventDispatcher ded = DataEventDispatcher.getInstance();
ded.addLanguageChangedListener(this, false);
- ded.addProjectOpenedListener(this);
+ ded.addProjectStateListener(this);
ICommandService commandService = (ICommandService) PlatformUI
.getWorkbench().getService(ICommandService.class);
@@ -106,11 +107,11 @@ public static CompletenessBP getInstance() {
return instance;
}
- /**
- * {@inheritDoc}
- */
- public void handleProjectOpened() {
- completeProjectCheck();
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.opened.equals(state)) {
+ completeProjectCheck();
+ }
}
/**
View
5 ...ent.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/ComponentNameReuseBP.java
@@ -49,8 +49,9 @@
* Adds this instance as a listener for data events.
*/
private ComponentNameReuseBP() {
- DataEventDispatcher.getInstance().addDataChangedListener(this, false);
- DataEventDispatcher.getInstance().addProjectLoadedListener(this, false);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addDataChangedListener(this, false);
+ ded.addProjectLoadedListener(this, false);
}
/**
View
4 ...jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/ProblemsBP.java
@@ -279,7 +279,7 @@ private void problemAUTNameNotSet(ITestJobPO testJob,
/**
* remove all old problems
*/
- private void clearOldProblems() {
+ public void clearOldProblems() {
for (IProblem problem : m_localProblemsToShow) {
Object data = problem.getData();
if (data instanceof INodePO) {
@@ -599,7 +599,7 @@ private void createMarker(String message, int messageType,
/**
* Deletes all problems in the problems view.
*/
- private void cleanupProblems() {
+ public void cleanupProblems() {
boolean doLoop = true;
while (doLoop) {
doLoop = false;
View
73 ...jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/StartAutBP.java
@@ -26,8 +26,8 @@
import org.eclipse.core.runtime.IStatus;
import org.eclipse.core.runtime.Status;
import org.eclipse.core.runtime.jobs.Job;
-import org.eclipse.jubula.client.core.communication.ConnectionException;
import org.eclipse.jubula.client.core.communication.AutAgentConnection;
+import org.eclipse.jubula.client.core.communication.ConnectionException;
import org.eclipse.jubula.client.core.events.DataChangedEvent;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.AutState;
@@ -36,8 +36,9 @@
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IDataChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ILanguageChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IServerConnectionListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ServerState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IAUTConfigPO;
@@ -220,31 +221,32 @@ public void handleLanguageChanged(Locale locale) {
/**
* <code>m_projPropModifyListener</code> listener for modification of project properties
*/
- private IProjectPropertiesModifyListener m_projPropModifyListener =
- new IProjectPropertiesModifyListener() {
-
- @SuppressWarnings("synthetic-access")
- public void handleProjectPropsChanged() {
- if (getLastUsedAut() == null || getLastUsedConf() == null) {
- fireAUTButtonStateCouldBeChanged();
- return;
- }
- String autName = getLastUsedAut().getName();
- String confName = getLastUsedConf().getName();
- for (IAUTMainPO aut : GeneralStorage.getInstance().getProject()
- .getAutMainList()) {
-
- if (autName.equals(aut.getName())) {
- for (IAUTConfigPO conf : aut.getAutConfigSet()) {
- if (confName.equals(conf.getName())) {
- setLastUsedAut(aut);
- setLastUsedAutConf(conf);
- return;
+ private IProjectStateListener m_projPropModifyListener =
+ new IProjectStateListener() {
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.prop_modified.equals(state)) {
+ if (getLastUsedAut() == null || getLastUsedConf() == null) {
+ fireAUTButtonStateCouldBeChanged();
+ return;
+ }
+ String autName = getLastUsedAut().getName();
+ String confName = getLastUsedConf().getName();
+ for (IAUTMainPO aut : GeneralStorage.getInstance()
+ .getProject().getAutMainList()) {
+
+ if (autName.equals(aut.getName())) {
+ for (IAUTConfigPO conf : aut.getAutConfigSet()) {
+ if (confName.equals(conf.getName())) {
+ setLastUsedAut(aut);
+ setLastUsedAutConf(conf);
+ return;
+ }
}
}
- }
+ }
+ fireAUTButtonStateCouldBeChanged();
}
- fireAUTButtonStateCouldBeChanged();
}
};
@@ -257,23 +259,16 @@ private StartAutBP() {
}
/**
- *
+ * init this BP instance
*/
private void init() {
- final DataEventDispatcher dataEventDispatcher =
- DataEventDispatcher.getInstance();
- dataEventDispatcher.addProjectLoadedListener(
- m_projLoadedListener, true);
- dataEventDispatcher.addDataChangedListener(
- m_currentProjDeletedListener, true);
- dataEventDispatcher.addAutAgentConnectionListener(
- m_serverConnectListener, true);
- dataEventDispatcher.addAutStateListener(m_autStateListener, true);
- dataEventDispatcher.addLanguageChangedListener(m_langChangedListener,
- true);
- dataEventDispatcher.addProjectPropertiesModifyListener(
- m_projPropModifyListener, true);
-
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addProjectLoadedListener(m_projLoadedListener, true);
+ ded.addDataChangedListener(m_currentProjDeletedListener, true);
+ ded.addAutAgentConnectionListener(m_serverConnectListener, true);
+ ded.addAutStateListener(m_autStateListener, true);
+ ded.addLanguageChangedListener(m_langChangedListener, true);
+ ded.addProjectStateListener(m_projPropModifyListener);
}
/**
View
37 ...client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/businessprocess/WorkingLanguageBP.java
@@ -19,7 +19,8 @@
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IDataChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.model.IAUTMainPO;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.ITestSuitePO;
@@ -42,22 +43,23 @@
/**
* <code>m_projectPropertiesModifyListener</code> listener for modification
- * of project properties (in this case escpecially for modification of
+ * of project properties (in this case especially for modification of
* project languages
*/
- private IProjectPropertiesModifyListener m_projectPropertiesModifyListener =
- new IProjectPropertiesModifyListener() {
-
- public void handleProjectPropsChanged() {
- List <Locale> langs = GeneralStorage.getInstance().getProject()
- .getLangHelper().getLanguageList();
- if (m_currentLanguage != null
- && !langs.contains(m_currentLanguage)) {
- m_currentLanguage = null;
- setCurrentLanguage(getWorkingLanguage());
+ private IProjectStateListener m_projectPropertiesModifyListener =
+ new IProjectStateListener() {
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.prop_modified.equals(state)) {
+ List <Locale> langs = GeneralStorage.getInstance()
+ .getProject().getLangHelper().getLanguageList();
+ if (m_currentLanguage != null
+ && !langs.contains(m_currentLanguage)) {
+ m_currentLanguage = null;
+ setCurrentLanguage(getWorkingLanguage());
+ }
}
}
-
};
/**
@@ -78,11 +80,10 @@ public void handleDataChanged(DataChangedEvent... events) {
* private constructor
*/
private WorkingLanguageBP() {
- DataEventDispatcher dispatcher = DataEventDispatcher.getInstance();
- dispatcher.addProjectLoadedListener(this, true);
- dispatcher.addProjectPropertiesModifyListener(
- m_projectPropertiesModifyListener, true);
- dispatcher.addDataChangedListener(m_dataChangedListener, true);
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addProjectLoadedListener(this, true);
+ ded.addProjectStateListener(m_projectPropertiesModifyListener);
+ ded.addDataChangedListener(m_dataChangedListener, true);
}
/**
View
6 ...la.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/controllers/PMExceptionHandler.java
@@ -141,8 +141,10 @@ public void run() {
Utils.clearClient();
GeneralStorage.getInstance().setProject(null);
if (oldProj != null) {
- DataEventDispatcher.getInstance().fireDataChangedListener(
- oldProj, DataState.Deleted, UpdateState.all);
+ final DataEventDispatcher ded =
+ DataEventDispatcher.getInstance();
+ ded.fireDataChangedListener(oldProj,
+ DataState.Deleted, UpdateState.all);
}
}
});
View
6 ...pse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/editors/JBEditorHelper.java
@@ -345,9 +345,9 @@ protected void addListeners() {
m_activeListener = new ActiveListener();
m_editor.getSite().getPage().getWorkbenchWindow().getSelectionService()
.addSelectionListener(m_activeListener);
- DataEventDispatcher.getInstance().addDataChangedListener(
- m_editor, true);
- DataEventDispatcher.getInstance().addProjectLoadedListener(this, true);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addDataChangedListener(m_editor, true);
+ ded.addProjectLoadedListener(this, true);
}
/**
View
4 ...ient.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/CreateAutDefinitionHandler.java
@@ -18,6 +18,7 @@
import org.eclipse.jface.window.Window;
import org.eclipse.jubula.client.core.businessprocess.RunningAutBP;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.model.IAUTMainPO;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.PoMaker;
@@ -91,7 +92,8 @@ public Object executeImpl(ExecutionEvent event) {
.refresh(GeneralStorage.getInstance()
.getProject().getAutCont());
DataEventDispatcher.getInstance()
- .fireProjectPropertiesModified();
+ .fireProjectStateChanged(
+ ProjectState.prop_modified);
}
} catch (PMException e) {
ErrorHandlingUtil.createMessageDialog(e, null, null);
View
13 ....ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/CreateNewProjectVersionHandler.java
@@ -30,6 +30,7 @@
import org.eclipse.jubula.client.core.businessprocess.ProjectComponentNameMapper;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
@@ -254,8 +255,9 @@ private void attachProjectWithProgress(IProgressMonitor monitor,
if (clearedProject != null) {
Utils.clearClient();
GeneralStorage.getInstance().setProject(null);
- DataEventDispatcher.getInstance()
- .fireDataChangedListener(clearedProject, DataState.Deleted,
+ final DataEventDispatcher ded = DataEventDispatcher
+ .getInstance();
+ ded.fireDataChangedListener(clearedProject, DataState.Deleted,
UpdateState.all);
}
List<INameMapper> mapperList = new ArrayList<INameMapper>();
@@ -274,10 +276,9 @@ private void attachProjectWithProgress(IProgressMonitor monitor,
* call this if the "save as" has ended to update the GUI.
*/
private void fireReady() {
- DataEventDispatcher dispatcher =
- DataEventDispatcher.getInstance();
- dispatcher.fireProjectLoadedListener(new NullProgressMonitor());
- dispatcher.fireProjectOpenedListener();
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.fireProjectLoadedListener(new NullProgressMonitor());
+ ded.fireProjectStateChanged(ProjectState.opened);
}
/**
View
10 ...nt.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/DeleteProjectHandler.java
@@ -129,6 +129,8 @@ public void run() {
monitor);
ProjectPM.deleteProject(m_project, m_deleteCurrentProject);
final String jobName = Messages.UIJobDeletingTestResultDetails;
+ final DataEventDispatcher ded = DataEventDispatcher
+ .getInstance();
Job job = new Job(jobName) {
public IStatus run(IProgressMonitor mon) {
mon.beginTask(jobName, IProgressMonitor.UNKNOWN);
@@ -144,17 +146,15 @@ public IStatus run(IProgressMonitor mon) {
m_project.getMinorProjectVersion(), false);
}
mon.done();
- DataEventDispatcher.getInstance()
- .fireTestresultChanged(TestresultState.Refresh);
+ ded.fireTestresultChanged(TestresultState.Refresh);
return Status.OK_STATUS;
}
};
if (m_deleteCurrentProject) {
Utils.clearClient();
GeneralStorage.getInstance().setProject(null);
- DataEventDispatcher.getInstance()
- .fireDataChangedListener(m_project, DataState.Deleted,
- UpdateState.all);
+ ded.fireDataChangedListener(m_project,
+ DataState.Deleted, UpdateState.all);
} else if (isRefreshRequired) {
GeneralStorage.getInstance().reloadMasterSession(
new NullProgressMonitor());
View
10 ...ient.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/OpenProjectHandler.java
@@ -32,6 +32,7 @@
import org.eclipse.jubula.client.core.businessprocess.progress.ProgressMonitorTracker;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IReusedProjectPO;
@@ -314,8 +315,10 @@ public void handleOperationException() {
if (clearedProject != null) {
Utils.clearClient();
GeneralStorage.getInstance().setProject(null);
- DataEventDispatcher.getInstance().fireDataChangedListener(
- clearedProject, DataState.Deleted, UpdateState.all);
+ final DataEventDispatcher ded = DataEventDispatcher
+ .getInstance();
+ ded.fireDataChangedListener(clearedProject, DataState.Deleted,
+ UpdateState.all);
}
}
@@ -454,7 +457,8 @@ public void loadProject(ProjectDialog.ProjectData projectData,
try {
PlatformUI.getWorkbench().getProgressService()
.busyCursorWhile(openOperation);
- DataEventDispatcher.getInstance().fireProjectOpenedListener();
+ DataEventDispatcher.getInstance().fireProjectStateChanged(
+ ProjectState.opened);
checkAndNagForMissingProjects();
} catch (InvocationTargetException ite) {
openOperation.handleOperationException();
View
4 ...t.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/RefreshProjectHandler.java
@@ -21,6 +21,7 @@
import org.eclipse.jface.operation.IRunnableWithProgress;
import org.eclipse.jubula.client.core.businessprocess.progress.ProgressMonitorTracker;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IReusedProjectPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
@@ -154,7 +155,8 @@ public IStatus refreshProject() {
return Status.CANCEL_STATUS;
} finally {
Plugin.stopLongRunning();
- DataEventDispatcher.getInstance().fireProjectOpenedListener();
+ DataEventDispatcher.getInstance().fireProjectStateChanged(
+ ProjectState.opened);
}
return Status.OK_STATUS;
View
12 ...nt.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/handlers/project/SaveProjectAsHandler.java
@@ -31,6 +31,7 @@
import org.eclipse.jubula.client.core.businessprocess.ProjectNameBP;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.persistence.GeneralStorage;
@@ -211,8 +212,9 @@ private void attachProjectWithProgress(IProgressMonitor monitor,
if (clearedProject != null) {
Utils.clearClient();
GeneralStorage.getInstance().setProject(null);
- DataEventDispatcher.getInstance()
- .fireDataChangedListener(clearedProject, DataState.Deleted,
+ final DataEventDispatcher ded = DataEventDispatcher
+ .getInstance();
+ ded.fireDataChangedListener(clearedProject, DataState.Deleted,
UpdateState.all);
}
List<INameMapper> mapperList = new ArrayList<INameMapper>();
@@ -288,9 +290,9 @@ protected void okPressed() {
* call this if the "save as" has ended to update the GUI.
*/
private void fireReady() {
- DataEventDispatcher dispatcher = DataEventDispatcher.getInstance();
- dispatcher.fireProjectLoadedListener(new NullProgressMonitor());
- dispatcher.fireProjectOpenedListener();
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.fireProjectLoadedListener(new NullProgressMonitor());
+ ded.fireProjectStateChanged(ProjectState.opened);
}
/**
View
4 ...nt.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/properties/ProjectGeneralPropertyPage.java
@@ -21,6 +21,7 @@
import org.eclipse.jubula.client.core.businessprocess.ProjectNameBP;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.DataState;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.UpdateState;
import org.eclipse.jubula.client.core.model.IProjectPO;
import org.eclipse.jubula.client.core.model.IProjectPropertiesPO;
@@ -527,7 +528,8 @@ public boolean performOk() {
newReused.removeAll(origReused);
getEditSupport().saveWorkVersion();
refreshAutMainList();
- DataEventDispatcher.getInstance().fireProjectPropertiesModified();
+ DataEventDispatcher.getInstance().fireProjectStateChanged(
+ ProjectState.prop_modified);
for (IReusedProjectPO reused : newReused) {
try {
IProjectPO reusedProject =
View
10 ....rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/ActiveProjectSourceProvider.java
@@ -64,8 +64,9 @@
* Constructor.
*/
public ActiveProjectSourceProvider() {
- DataEventDispatcher.getInstance().addProjectLoadedListener(this, true);
- DataEventDispatcher.getInstance().addDataChangedListener(this, true);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addProjectLoadedListener(this, true);
+ ded.addDataChangedListener(this, true);
DatabaseStateDispatcher.addDatabaseStateListener(this);
MultipleTCBTracker.getInstance().setProvider(this);
}
@@ -75,8 +76,9 @@ public ActiveProjectSourceProvider() {
* {@inheritDoc}
*/
public void dispose() {
- DataEventDispatcher.getInstance().removeProjectLoadedListener(this);
- DataEventDispatcher.getInstance().removeDataChangedListener(this);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.removeProjectLoadedListener(this);
+ ded.removeDataChangedListener(this);
DatabaseStateDispatcher.removeDatabaseStateListener(this);
MultipleTCBTracker.getInstance().setProvider(null);
}
View
49 ...i.rcp/src/org/eclipse/jubula/client/ui/rcp/sourceprovider/AvailableAutSourceProvider.java
@@ -24,8 +24,9 @@
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IDataChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ILanguageChangedListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IServerConnectionListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.ServerState;
import org.eclipse.jubula.client.core.model.IPersistentObject;
import org.eclipse.jubula.client.core.model.IProjectPO;
@@ -47,7 +48,7 @@
*/
public class AvailableAutSourceProvider extends AbstractJBSourceProvider
implements ILanguageChangedListener, IServerConnectionListener,
- IProjectPropertiesModifyListener,
+ IProjectStateListener,
IProjectLoadedListener, IDataChangedListener {
/**
@@ -61,12 +62,12 @@
* Constructor.
*/
public AvailableAutSourceProvider() {
- DataEventDispatcher dispatcher = DataEventDispatcher.getInstance();
- dispatcher.addLanguageChangedListener(this, true);
- dispatcher.addAutAgentConnectionListener(this, true);
- dispatcher.addProjectPropertiesModifyListener(this, true);
- dispatcher.addProjectLoadedListener(this, true);
- dispatcher.addDataChangedListener(this, true);
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addLanguageChangedListener(this, true);
+ ded.addAutAgentConnectionListener(this, true);
+ ded.addProjectStateListener(this);
+ ded.addProjectLoadedListener(this, true);
+ ded.addDataChangedListener(this, true);
}
/**
@@ -74,12 +75,12 @@ public AvailableAutSourceProvider() {
* {@inheritDoc}
*/
public void dispose() {
- DataEventDispatcher dispatcher = DataEventDispatcher.getInstance();
- dispatcher.removeLanguageChangedListener(this);
- dispatcher.removeAutAgentConnectionListener(this);
- dispatcher.removeProjectPropertiesModifyListener(this);
- dispatcher.removeProjectLoadedListener(this);
- dispatcher.removeDataChangedListener(this);
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.removeLanguageChangedListener(this);
+ ded.removeAutAgentConnectionListener(this);
+ ded.removeProjectStateListener(this);
+ ded.removeProjectLoadedListener(this);
+ ded.removeDataChangedListener(this);
}
/**
@@ -139,20 +140,18 @@ protected IStatus run(IProgressMonitor monitor) {
private boolean isAutAvailable() {
return !StartAutBP.getInstance().getAllAUTs().isEmpty();
}
-
- /**
- * {@inheritDoc}
- */
- public void handleProjectPropsChanged() {
- fireSourceChanged();
- }
-
- /**
- * {@inheritDoc}
- */
+
+ /** {@inheritDoc} */
public void handleProjectLoaded() {
fireSourceChanged();
}
+
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.prop_modified.equals(state)) {
+ fireSourceChanged();
+ }
+ }
/** {@inheritDoc} */
public void handleDataChanged(DataChangedEvent... events) {
View
6 org.eclipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/utils/Utils.java
@@ -25,6 +25,7 @@
import org.eclipse.jubula.client.core.businessprocess.TestExecution;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.OMState;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.RecordModeState;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.TestresultState;
import org.eclipse.jubula.client.core.model.ICapPO;
@@ -37,6 +38,7 @@
import org.eclipse.jubula.client.core.utils.Languages;
import org.eclipse.jubula.client.ui.constants.Constants;
import org.eclipse.jubula.client.ui.rcp.Plugin;
+import org.eclipse.jubula.client.ui.rcp.businessprocess.ProblemsBP;
import org.eclipse.jubula.client.ui.rcp.controllers.MultipleTCBTracker;
import org.eclipse.jubula.client.ui.rcp.controllers.TestExecutionContributor;
import org.eclipse.jubula.client.ui.rcp.editors.PersistableEditorInput;
@@ -255,10 +257,14 @@ public static void clearClient(final boolean alsoProjectIndependent) {
}
Plugin.getDisplay().syncExec(new Runnable() {
public void run() {
+ final ProblemsBP problemsBP = ProblemsBP.getInstance();
+ problemsBP.clearOldProblems();
+ problemsBP.cleanupProblems();
TestExecutionContributor.getInstance().getClientTest()
.resetToTesting();
ded.fireRecordModeStateChanged(RecordModeState.notRunning);
ded.fireOMStateChanged(OMState.notRunning);
+ ded.fireProjectStateChanged(ProjectState.closed);
Plugin.closeAllOpenedJubulaEditors(alsoProjectIndependent);
ded.fireTestresultChanged(TestresultState.Refresh);
setTreeViewerInputNull(Constants.TESTRE_ID);
View
7 ...e.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/AbstractJBTreeView.java
@@ -256,10 +256,9 @@ public void createPartControl(Composite parent) {
getSite().setSelectionProvider(getTreeViewer());
getTreeViewer().setAutoExpandLevel(DEFAULT_EXPANSION);
- final DataEventDispatcher dispatcher =
- DataEventDispatcher.getInstance();
- dispatcher.addProjectLoadedListener(this, false);
- dispatcher.addDataChangedListener(this, true);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addProjectLoadedListener(this, false);
+ ded.addDataChangedListener(this, true);
getViewSite().getActionBars().getToolBarManager().add(
new ToggleLinkingAction());
View
21 ...ipse.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/RunningAutsView.java
@@ -21,7 +21,8 @@
import org.eclipse.jubula.client.core.agent.IAutRegistrationListener;
import org.eclipse.jubula.client.core.events.DataEventDispatcher;
import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectLoadedListener;
-import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectPropertiesModifyListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.IProjectStateListener;
+import org.eclipse.jubula.client.core.events.DataEventDispatcher.ProjectState;
import org.eclipse.jubula.client.ui.constants.ContextHelpIds;
import org.eclipse.jubula.client.ui.rcp.Plugin;
import org.eclipse.jubula.client.ui.rcp.provider.labelprovider.RunningAutsViewLabelProvider;
@@ -39,7 +40,7 @@
* @created Jan 26, 2010
*/
public class RunningAutsView extends ViewPart
- implements IProjectLoadedListener, IProjectPropertiesModifyListener {
+ implements IProjectLoadedListener, IProjectStateListener {
/** listens for changes in AUT registration */
private IAutRegistrationListener m_autRegListener;
@@ -98,7 +99,7 @@ public void run() {
new RunningAutsViewLabelProvider());
DataEventDispatcher ded = DataEventDispatcher.getInstance();
ded.addProjectLoadedListener(this, true);
- ded.addProjectPropertiesModifyListener(this, true);
+ ded.addProjectStateListener(this);
Plugin.getHelpSystem().setHelp(m_runningAutComponent.getControl(),
ContextHelpIds.RUNNING_AUTS_VIEW);
@@ -127,7 +128,7 @@ public void dispose() {
AutAgentRegistration.getInstance().removeListener(m_autRegListener);
DataEventDispatcher ded = DataEventDispatcher.getInstance();
ded.removeProjectLoadedListener(this);
- ded.removeProjectPropertiesModifyListener(this);
+ ded.removeProjectStateListener(this);
super.dispose();
}
@@ -139,7 +140,7 @@ public void handleProjectLoaded() {
}
/**
- * refreshes the viewer incl. the labels
+ * refreshes the viewer and the labels
*/
private void refreshViewer() {
Plugin.getDisplay().syncExec(new Runnable() {
@@ -149,10 +150,10 @@ public void run() {
});
}
- /**
- * {@inheritDoc}
- */
- public void handleProjectPropsChanged() {
- refreshViewer();
+ /** {@inheritDoc} */
+ public void handleProjectStateChanged(ProjectState state) {
+ if (ProjectState.prop_modified.equals(state)) {
+ refreshViewer();
+ }
}
}
View
6 ...e.jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/TestResultTreeView.java
@@ -154,9 +154,9 @@ public void createPartControl(Composite parent) {
getTreeViewer().getControl().setLayoutData(layoutData);
getSite().setSelectionProvider(getTreeViewer());
createContextMenu();
- DataEventDispatcher.getInstance().addDataChangedListener(this, true);
- DataEventDispatcher.getInstance().addProjectLoadedListener(this,
- true);
+ final DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addDataChangedListener(this, true);
+ ded.addProjectLoadedListener(this, true);
}
/**
View
8 ....jubula.client.ui.rcp/src/org/eclipse/jubula/client/ui/rcp/views/dataset/DataSetView.java
@@ -131,10 +131,10 @@ public IWorkbenchPart getContributingPart() {
*/
public void init(IViewSite site) throws PartInitException {
site.getPage().addSelectionListener(this);
- DataEventDispatcher dispatcher = DataEventDispatcher.getInstance();
- dispatcher.addParamChangedListener(this, true);
- dispatcher.addLanguageChangedListener(this, true);
- dispatcher.addProjectLoadedListener(this, true);
+ DataEventDispatcher ded = DataEventDispatcher.getInstance();
+ ded.addParamChangedListener(this, true);
+ ded.addLanguageChangedListener(this, true);
+ ded.addProjectLoadedListener(this, true);
super.init(site);
}

0 comments on commit beff073

Please sign in to comment.
Something went wrong with that request. Please try again.