summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-26 12:35:05 (EDT)
committer Roberto E. Escobar2011-10-26 12:35:05 (EDT)
commitacf6e338be8f4a7f2db389af9bbd1ed98220a973 (patch)
tree854494a9a9195330622c974174c4fe0ba7c6dcc4
parent9ee827e6772b3aacd192d48c916741fcaf94ea2a (diff)
downloadorg.eclipse.osee-acf6e338be8f4a7f2db389af9bbd1ed98220a973.zip
org.eclipse.osee-acf6e338be8f4a7f2db389af9bbd1ed98220a973.tar.gz
org.eclipse.osee-acf6e338be8f4a7f2db389af9bbd1ed98220a973.tar.bz2
feature[ats_E6W8N]: Implement web UI title
Conflicts: plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java11
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java11
-rw-r--r--plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java91
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java6
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java7
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeDisplayOptionsComponentImpl.java2
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java9
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java10
-rw-r--r--plugins/org.eclipse.osee.vaadin.widgets/src/org/eclipse/osee/vaadin/widgets/HasViewTitle.java18
9 files changed, 75 insertions, 90 deletions
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java
index 6bbfb56..4f27fe4 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsNavigator.java
@@ -14,7 +14,6 @@ import org.eclipse.osee.ats.view.web.search.AtsArtifactView;
import org.eclipse.osee.ats.view.web.search.AtsSearchResultsView;
import org.eclipse.osee.display.api.search.SearchNavigator;
import org.eclipse.osee.vaadin.widgets.Navigator;
-import com.vaadin.Application;
/**
* @author Shawn F. Cook
@@ -24,24 +23,14 @@ public class AtsNavigator extends Navigator implements SearchNavigator {
@Override
public void navigateSearchResults(String url) {
- updateGlobalUrlState(url);
String classUri = getUri(AtsSearchResultsView.class);
this.navigateTo(String.format("%s%s", classUri, url));
}
@Override
public void navigateArtifactPage(String url) {
- updateGlobalUrlState(url);
String classUri = getUri(AtsArtifactView.class);
this.navigateTo(String.format("%s%s", classUri, url));
}
- private void updateGlobalUrlState(String url) {
- Application application = getApplication();
- if (application instanceof AtsUiApplication) {
- AtsUiApplication<?, ?> atsApp = (AtsUiApplication<?, ?>) application;
- atsApp.setUrl(url);
- }
- }
-
}
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java
index 346938b..70a1c69 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/AtsWindowFactory.java
@@ -11,6 +11,7 @@
package org.eclipse.osee.ats.view.web;
import org.eclipse.osee.vaadin.widgets.AccountMenuBar;
+import org.eclipse.osee.vaadin.widgets.HasViewTitle;
import org.eclipse.osee.vaadin.widgets.HasViews;
import org.eclipse.osee.vaadin.widgets.Navigator;
import org.eclipse.osee.vaadin.widgets.Navigator.View;
@@ -47,8 +48,14 @@ public class AtsWindowFactory {
@Override
public void navigatorViewChange(View previous, View current) {
Window mainWindow = w.getApplication().getMainWindow();
- mainWindow.setCaption("OSEE - " + current.getClass().getSimpleName());
- // mainWindow.showNotification("Navigated to " + current.getClass().getName());
+ String title = "OSEE";
+ if (current instanceof HasViewTitle) {
+ String currentTitle = ((HasViewTitle) current).getViewTitle();
+ if (currentTitle != null && !currentTitle.isEmpty()) {
+ title = String.format("%s - %s", title, currentTitle);
+ }
+ }
+ mainWindow.setCaption(title);
}
});
return w;
diff --git a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
index efc4d7c..0faff32 100644
--- a/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
+++ b/plugins/org.eclipse.osee.ats.view.web/src/org/eclipse/osee/ats/view/web/components/AtsSearchHeaderImpl.java
@@ -17,14 +17,13 @@ import org.eclipse.osee.ats.view.web.AtsNavigator;
import org.eclipse.osee.ats.view.web.AtsUiApplication;
import org.eclipse.osee.ats.view.web.search.AtsSearchResultsView;
import org.eclipse.osee.display.api.data.ViewId;
-import org.eclipse.osee.display.api.search.SearchProgressListener;
-import org.eclipse.osee.display.api.search.SearchProgressProvider;
import org.eclipse.osee.display.view.web.CssConstants;
import org.eclipse.osee.display.view.web.components.ComponentUtility;
import org.eclipse.osee.display.view.web.components.OseeExceptionDialogComponent;
import org.eclipse.osee.display.view.web.components.OseeLeftMarginContainer;
import org.eclipse.osee.display.view.web.components.OseeLogoLink;
import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
+import org.eclipse.osee.vaadin.widgets.HasViewTitle;
import com.vaadin.data.Property;
import com.vaadin.data.Property.ValueChangeEvent;
import com.vaadin.event.Action;
@@ -37,36 +36,27 @@ import com.vaadin.ui.ComboBox;
import com.vaadin.ui.HorizontalLayout;
import com.vaadin.ui.Label;
import com.vaadin.ui.Panel;
-import com.vaadin.ui.ProgressIndicator;
import com.vaadin.ui.TextField;
import com.vaadin.ui.VerticalLayout;
-import com.vaadin.ui.Window.Notification;
/**
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements AtsSearchHeaderComponent, Handler, SearchProgressListener {
+public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements AtsSearchHeaderComponent, Handler, HasViewTitle {
- private final String SEARCHBUTTON_SEARCH = "Search";
- private final String SEARCHBUTTON_CANCEL = "Cancel";
private boolean isLayoutComplete = false;
private final ComboBox programCombo = new ComboBox("Program:");
private final ComboBox buildCombo = new ComboBox("Build:");
private final CheckBox nameOnlyCheckBox = new CheckBox("Name Only", true);
private final TextField searchTextField = new TextField();
- private final Button searchButton = new Button(SEARCHBUTTON_SEARCH);
+ private final Button searchButton = new Button("Search");
private boolean lockProgramCombo = false;
- private final Panel searchTextPanel = new Panel();
- private final ProgressIndicator progressIndicator = new ProgressIndicator();
+ Panel searchTextPanel = new Panel();
@Override
public void attach() {
if (!isLayoutComplete) {
- AtsSearchPresenter searchPresenter = getPresenter();
- if (searchPresenter != null && searchPresenter instanceof SearchProgressProvider) {
- ((SearchProgressProvider) searchPresenter).addListener(this);
- }
createLayout();
}
isLayoutComplete = true;
@@ -120,35 +110,18 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
}
protected void selectSearch() {
- Runnable thread = new Runnable() {
- @Override
- public void run() {
- for (int i = 0; i < 9999; i++) {
- try {
- Thread.sleep(1000);
- } catch (InterruptedException ex) {
- }
- nameOnlyCheckBox.setCaption(String.format("%d", i));
- }
+ if (searchButton.isEnabled()) {
+ if (ComponentUtility.isAccessible(programCombo, buildCombo, nameOnlyCheckBox, searchTextField)) {
+ ViewId program = (ViewId) programCombo.getValue();
+ ViewId build = (ViewId) buildCombo.getValue();
+ boolean nameOnly = nameOnlyCheckBox.toString().equalsIgnoreCase("true");
+ String searchPhrase = (String) searchTextField.getValue();
+ AtsSearchParameters params = new AtsSearchParameters(searchPhrase, nameOnly, build, program);
+ getPresenter().selectSearch(getRequestedDataId(), params, getNavigator());
+ } else {
+ System.out.println("AtsSearchHeaderComponent.selectSearch - WARNING: null value detected.");
}
- };
- thread.run();
- // if (searchButton.isEnabled()) {
- // if (searchButton.getCaption().equals(SEARCHBUTTON_SEARCH)) {
- // if (ComponentUtility.isAccessible(programCombo, buildCombo, nameOnlyCheckBox, searchTextField)) {
- // ViewId program = (ViewId) programCombo.getValue();
- // ViewId build = (ViewId) buildCombo.getValue();
- // boolean nameOnly = nameOnlyCheckBox.toString().equalsIgnoreCase("true");
- // String searchPhrase = (String) searchTextField.getValue();
- // AtsSearchParameters params = new AtsSearchParameters(searchPhrase, nameOnly, build, program);
- // getPresenter().selectSearch(getRequestedDataId(), params, getNavigator());
- // } else {
- // System.out.println("AtsSearchHeaderComponent.selectSearch - WARNING: null value detected.");
- // }
- // } else if (searchButton.getCaption().equals(SEARCHBUTTON_CANCEL)) {
- // getPresenter().selectCancel();
- // }
- // }
+ }
}
public void createLayout() {
@@ -200,7 +173,6 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
searchTextPanel.setScrollable(false);
searchTextPanel.addActionHandler(this);
searchTextPanel.setContent(hLayout_SearchText);
- progressIndicator.setPollingInterval(500);
hLayout_SearchText.addComponent(searchTextField);
@@ -213,7 +185,6 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
hLayout_SearchTextBtn.addComponent(searchTextPanel);
hLayout_SearchTextBtn.addComponent(hSpacer_SearchTextBtn);
hLayout_SearchTextBtn.addComponent(searchButton);
- hLayout_SearchTextBtn.addComponent(progressIndicator);
vLayout_SearchCrit.addComponent(hLayout_ProgBuildName);
vLayout_SearchCrit.addComponent(hLayout_SearchTextBtn);
@@ -335,35 +306,7 @@ public class AtsSearchHeaderImpl extends OseeSearchHeaderComponent implements At
}
@Override
- public void searchInProgress() {
- System.out.println("Search in progress.");
- programCombo.setEnabled(false);
- buildCombo.setEnabled(false);
- nameOnlyCheckBox.setEnabled(false);
- searchTextField.setEnabled(false);
- searchButton.setCaption(SEARCHBUTTON_CANCEL);
- }
-
- @Override
- public void searchCancelled() {
- System.out.println("Search cancelled.");
- programCombo.setEnabled(true);
- buildCombo.setEnabled(true);
- nameOnlyCheckBox.setEnabled(true);
- searchTextField.setEnabled(true);
- validateSearchAndEnableSearchButton();
- searchButton.setCaption(SEARCHBUTTON_SEARCH);
- getApplication().getMainWindow().showNotification("Search Cancelled", Notification.TYPE_TRAY_NOTIFICATION);
- }
-
- @Override
- public void searchCompleted() {
- System.out.println("Search complete.");
- programCombo.setEnabled(true);
- buildCombo.setEnabled(true);
- nameOnlyCheckBox.setEnabled(true);
- searchTextField.setEnabled(true);
- validateSearchAndEnableSearchButton();
- searchButton.setCaption(SEARCHBUTTON_SEARCH);
+ public String getViewTitle() {
+ return (String) this.searchTextField.getValue();
}
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java
index 358fdff..101384d 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.display.view.web;
import org.eclipse.osee.display.api.search.SearchPresenter;
import org.eclipse.osee.display.view.web.components.ComponentUtility;
import org.eclipse.osee.display.view.web.components.OseeSearchHeaderComponent;
+import org.eclipse.osee.vaadin.widgets.HasViewTitle;
import org.eclipse.osee.vaadin.widgets.Navigator;
import com.vaadin.Application;
import com.vaadin.ui.Alignment;
@@ -22,9 +23,9 @@ import com.vaadin.ui.VerticalLayout;
* @author Shawn F. Cook
*/
@SuppressWarnings("serial")
-public abstract class AbstractCommonView extends VerticalLayout implements Navigator.View {
+public abstract class AbstractCommonView extends VerticalLayout implements Navigator.View, HasViewTitle {
- private OseeSearchHeaderComponent searchHeader;
+ protected OseeSearchHeaderComponent searchHeader;
private SearchPresenter searchPresenter;
private boolean isLayoutComplete = false;
@@ -55,6 +56,7 @@ public abstract class AbstractCommonView extends VerticalLayout implements Navig
@Override
public final void navigateTo(String requestedDataId) {
+ ComponentUtility.setUrl(this, requestedDataId);
searchPresenter = ComponentUtility.getPresenter(this);
initialUrl = requestedDataId;
if (searchPresenter != null) {
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
index 0182804..05a5b12 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/ComponentUtility.java
@@ -57,6 +57,13 @@ public final class ComponentUtility {
return url;
}
+ public static void setUrl(Component component, String url) {
+ Application app = component.getApplication();
+ if (app instanceof HasUrl) {
+ ((HasUrl) app).setUrl(url);
+ }
+ }
+
public static SearchPresenter<?, ?> getPresenter(Component component) {
SearchPresenter presenter = null;
Application app = component.getApplication();
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeDisplayOptionsComponentImpl.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeDisplayOptionsComponentImpl.java
index 7530022..ad336da 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeDisplayOptionsComponentImpl.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeDisplayOptionsComponentImpl.java
@@ -76,7 +76,7 @@ public class OseeDisplayOptionsComponentImpl extends VerticalLayout implements D
String url = ComponentUtility.getUrl(OseeDisplayOptionsComponentImpl.this);
SearchNavigator navigator = ComponentUtility.getNavigator(OseeDisplayOptionsComponentImpl.this);
- SearchPresenter presenter = ComponentUtility.getPresenter(OseeDisplayOptionsComponentImpl.this);
+ SearchPresenter<?, ?> presenter = ComponentUtility.getPresenter(OseeDisplayOptionsComponentImpl.this);
if (presenter != null) {
presenter.selectDisplayOptions(url, options, navigator);
} else {
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
index 87b13e0..a15f615 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeArtifactView.java
@@ -144,4 +144,13 @@ public abstract class OseeArtifactView extends AbstractCommonView implements Art
OseeExceptionDialogComponent dlg =
new OseeExceptionDialogComponent(msgType, shortMsg, longMsg, getApplication().getMainWindow());
}
+
+ @Override
+ public String getViewTitle() {
+ if (this.artifact != null) {
+ return artifact.getArtifactName();
+ } else {
+ return "";
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
index 75bb5d8..2719659 100644
--- a/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
+++ b/plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/search/OseeSearchResultsView.java
@@ -13,6 +13,7 @@ package org.eclipse.osee.display.view.web.search;
import org.eclipse.osee.display.view.web.AbstractCommonView;
import org.eclipse.osee.display.view.web.components.OseeLeftMarginContainer;
import org.eclipse.osee.display.view.web.components.OseeSearchResultsListComponent;
+import org.eclipse.osee.vaadin.widgets.HasViewTitle;
/**
* @author Shawn F. Cook
@@ -34,4 +35,13 @@ public abstract class OseeSearchResultsView extends AbstractCommonView {
leftMargContainer.setExpandRatio(searchResultsListComponent, 1.0f);
setExpandRatio(leftMargContainer, 1.0f);
}
+
+ @Override
+ public String getViewTitle() {
+ if (searchHeader != null && searchHeader instanceof HasViewTitle) {
+ return ((HasViewTitle) searchHeader).getViewTitle();
+ } else {
+ return "";
+ }
+ }
}
diff --git a/plugins/org.eclipse.osee.vaadin.widgets/src/org/eclipse/osee/vaadin/widgets/HasViewTitle.java b/plugins/org.eclipse.osee.vaadin.widgets/src/org/eclipse/osee/vaadin/widgets/HasViewTitle.java
new file mode 100644
index 0000000..56a2b07
--- /dev/null
+++ b/plugins/org.eclipse.osee.vaadin.widgets/src/org/eclipse/osee/vaadin/widgets/HasViewTitle.java
@@ -0,0 +1,18 @@
+/*******************************************************************************
+ * Copyright (c) 2011 Boeing.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Boeing - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.osee.vaadin.widgets;
+
+/**
+ * @author Shawn F. Cook
+ */
+public interface HasViewTitle {
+ public String getViewTitle();
+}