summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshawn.f.cook2011-10-27 15:43:06 (EDT)
committer Roberto E. Escobar2011-10-27 15:43:06 (EDT)
commita8fe2a543e9e3a0e7ebcfc077849e3294eb5da56 (patch)
tree8f5a10dc36790c499e16235543552842da09981c
parentda2ba81456bdada28f5fa4e48070059441d3a1c5 (diff)
downloadorg.eclipse.osee-a8fe2a543e9e3a0e7ebcfc077849e3294eb5da56.zip
org.eclipse.osee-a8fe2a543e9e3a0e7ebcfc077849e3294eb5da56.tar.gz
org.eclipse.osee-a8fe2a543e9e3a0e7ebcfc077849e3294eb5da56.tar.bz2
feature[ats_E6W8N]: Only update verbose checkbox if value changed
-rw-r--r--plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java168
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/AbstractCommonView.java2
-rw-r--r--plugins/org.eclipse.osee.display.view.web/src/org/eclipse/osee/display/view/web/components/OseeDisplayOptionsComponentImpl.java26
3 files changed, 90 insertions, 106 deletions
diff --git a/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java b/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java
index 6941ece..8268763 100644
--- a/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java
+++ b/plugins/org.eclipse.osee.ats.presenter.mock/src/org/eclipse/osee/ats/presenter/mock/internal/MockAtsWebSearchPresenter.java
@@ -108,29 +108,18 @@ public class MockAtsWebSearchPresenter<T extends AtsSearchHeaderComponent, K ext
@Override
public void selectDisplayOptions(final String url, final DisplayOptions options, final SearchNavigator navigator) {
- fireSearchInProgressEvent();
+ if (navigator != null && options != null) {
+ Map<String, String> parameters = new HashMap<String, String>();
- Thread thread = new Thread(new Runnable() {
- @Override
- public void run() {
-
- if (navigator != null && options != null) {
- Map<String, String> parameters = new HashMap<String, String>();
-
- if (options.getVerboseResults() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE,
- options.getVerboseResults() ? "true" : "false");
- }
+ if (options.getVerboseResults() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE, options.getVerboseResults() ? "true" : "false");
+ }
- if (parameters.size() > 0) {
- String newurl = parameterMapToRequestString(parameters, url);
- navigator.navigateSearchResults(newurl);
- }
- }
- fireSearchCompletedEvent();
+ if (parameters.size() > 0) {
+ String newurl = parameterMapToRequestString(parameters, url);
+ navigator.navigateSearchResults(newurl);
}
- }, "thread1");
- thread.start();
+ }
}
@Override
@@ -140,46 +129,32 @@ public class MockAtsWebSearchPresenter<T extends AtsSearchHeaderComponent, K ext
@Override
public void selectSearch(final String url, final K params, final SearchNavigator navigator) {
- fireSearchInProgressEvent();
- Thread thread = new Thread(new Runnable() {
- @Override
- public void run() {
- if (navigator != null && params != null) {
- Map<String, String> parameters = new HashMap<String, String>();
+ if (navigator != null && params != null) {
+ Map<String, String> parameters = new HashMap<String, String>();
- if (params.getProgram() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_PROGRAM, params.getProgram().getGuid());
- }
- if (params.getBuild() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_BUILD, params.getBuild().getGuid());
- }
- if (params.isNameOnly() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_NAMEONLY, params.isNameOnly() ? "true" : "false");
- }
- if (params.getSearchString() != null) {
- parameters.put(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE, params.getSearchString());
- }
- if (parameters.size() > 0) {
- String newurl = parameterMapToRequestString(parameters, url);
- // try {
- // Thread.sleep(5000);
- // } catch (InterruptedException ex) {
- // //do nothing
- // }
- navigator.navigateSearchResults(newurl);
- fireSearchCompletedEvent();
- }
- }
+ if (params.getProgram() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_PROGRAM, params.getProgram().getGuid());
}
- }, "thread1");
+ if (params.getBuild() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_BUILD, params.getBuild().getGuid());
+ }
+ if (params.isNameOnly() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_NAMEONLY, params.isNameOnly() ? "true" : "false");
+ }
+ if (params.getSearchString() != null) {
+ parameters.put(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE, params.getSearchString());
+ }
+ if (parameters.size() > 0) {
+ String newurl = parameterMapToRequestString(parameters, url);
+ navigator.navigateSearchResults(newurl);
+ }
+ }
- thread.start();
}
private void updateSearchDisplayOptions(String url, DisplayOptionsComponent optionsComp) {
if (optionsComp != null) {
- optionsComp.clearAll();
Map<String, String> params = requestStringToParameterMap(url);
if (params != null && params.size() > 0) {
@@ -317,53 +292,64 @@ public class MockAtsWebSearchPresenter<T extends AtsSearchHeaderComponent, K ext
}
@Override
- public void initSearchResults(String url, T searchHeaderComp, SearchResultsListComponent searchResultsComp, DisplayOptionsComponent options) {
- updateSearchHeader(url, searchHeaderComp);
- updateSearchDisplayOptions(url, options);
+ public void initSearchResults(final String url, final T searchHeaderComp, final SearchResultsListComponent searchResultsComp, final DisplayOptionsComponent options) {
+ fireSearchInProgressEvent();
- if (searchResultsComp != null) {
- String searchPhrase = "";
- boolean nameOnly = false;
- boolean verbose = false;
- Map<String, String> params = requestStringToParameterMap(url);
- if (params != null && params.size() > 0) {
- searchPhrase = params.get(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE);
- if (searchPhrase == null) {
- searchPhrase = "";
- }
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
- String nameOnly_str = params.get(UrlParamNameConstants.PARAMNAME_NAMEONLY);
- if (nameOnly_str != null && !nameOnly_str.isEmpty()) {
- nameOnly = nameOnly_str.equalsIgnoreCase("true");
- }
+ updateSearchHeader(url, searchHeaderComp);
+ updateSearchDisplayOptions(url, options);
+
+ if (searchResultsComp != null) {
+ String searchPhrase = "";
+ boolean nameOnly = false;
+ boolean verbose = false;
+ Map<String, String> params = requestStringToParameterMap(url);
+ if (params != null && params.size() > 0) {
+ searchPhrase = params.get(UrlParamNameConstants.PARAMNAME_SEARCHPHRASE);
+ if (searchPhrase == null) {
+ searchPhrase = "";
+ }
- String verbose_str = params.get(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE);
- if (verbose_str != null && !verbose_str.isEmpty()) {
- verbose = verbose_str.equalsIgnoreCase("true");
- }
- }
- searchResultsComp.clearAll();
- if (!searchPhrase.isEmpty()) {
- Set<Entry<String, ViewArtifact>> entrySet = artifacts.entrySet();
- for (Entry<String, ViewArtifact> artifactEntry : entrySet) {
- ViewArtifact artifact = artifactEntry.getValue();
- if (artifact.getArtifactName().toLowerCase().contains(searchPhrase.toLowerCase())) {
- SearchResultComponent searchResultComp = searchResultsComp.createSearchResult();
- if (searchResultComp != null) {
- searchResultComp.setArtifact(artifact);
-
- DisplayOptions dispOptions = new DisplayOptions(verbose);
- searchResultComp.setDisplayOptions(dispOptions);
- if (!nameOnly && verbose) {
- StyledText matchHintText = new StyledText("...{COM_PAGE}...", true);
- searchResultComp.addSearchResultMatch(new SearchResultMatch("Word Template Content", 10,
- Arrays.asList(matchHintText)));
+ String nameOnly_str = params.get(UrlParamNameConstants.PARAMNAME_NAMEONLY);
+ if (nameOnly_str != null && !nameOnly_str.isEmpty()) {
+ nameOnly = nameOnly_str.equalsIgnoreCase("true");
+ }
+
+ String verbose_str = params.get(UrlParamNameConstants.PARAMNAME_SHOWVERBOSE);
+ if (verbose_str != null && !verbose_str.isEmpty()) {
+ verbose = verbose_str.equalsIgnoreCase("true");
+ }
+ }
+ searchResultsComp.clearAll();
+ if (!searchPhrase.isEmpty()) {
+ Set<Entry<String, ViewArtifact>> entrySet = artifacts.entrySet();
+ for (Entry<String, ViewArtifact> artifactEntry : entrySet) {
+ ViewArtifact artifact = artifactEntry.getValue();
+ if (artifact.getArtifactName().toLowerCase().contains(searchPhrase.toLowerCase())) {
+ SearchResultComponent searchResultComp = searchResultsComp.createSearchResult();
+ if (searchResultComp != null) {
+ searchResultComp.setArtifact(artifact);
+
+ DisplayOptions dispOptions = new DisplayOptions(verbose);
+ searchResultComp.setDisplayOptions(dispOptions);
+ if (!nameOnly && verbose) {
+ StyledText matchHintText = new StyledText("...{COM_PAGE}...", true);
+ searchResultComp.addSearchResultMatch(new SearchResultMatch("Word Template Content", 10,
+ Arrays.asList(matchHintText)));
+ }
+ }
}
}
}
}
+ fireSearchCompletedEvent();
}
- }
+ }, "thread1");
+
+ thread.start();
}
private static Map<String, String> requestStringToParameterMap(String requestedDataId) {
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 0195e1d..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
@@ -60,9 +60,7 @@ public abstract class AbstractCommonView extends VerticalLayout implements Navig
searchPresenter = ComponentUtility.getPresenter(this);
initialUrl = requestedDataId;
if (searchPresenter != null) {
- ComponentUtility.lockForNavigateTo();
callInit(initialUrl);
- ComponentUtility.unlockForNavigateTo();
}
}
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 e05ff77..df3d28f 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
@@ -59,24 +59,24 @@ public class OseeDisplayOptionsComponentImpl extends VerticalLayout implements D
@Override
public void setDisplayOptions(DisplayOptions options) {
if (options != null) {
- boolean verboseResults = options.getVerboseResults();
- showVerboseCheckBox.setValue(verboseResults);
+ boolean showVerbose_fromPres = options.getVerboseResults();
+ boolean showVerbose_fromUi = showVerboseCheckBox.toString().equalsIgnoreCase("true");
+ if (showVerbose_fromUi != showVerbose_fromPres) {
+ showVerboseCheckBox.setValue(showVerbose_fromPres);
+ }
}
}
private void onBoxChecked(boolean isShowVerbose) {
- if (ComponentUtility.tryLockForNavigateTo()) {
- DisplayOptions options = new DisplayOptions(isShowVerbose);
+ DisplayOptions options = new DisplayOptions(isShowVerbose);
- String url = ComponentUtility.getUrl(OseeDisplayOptionsComponentImpl.this);
- SearchNavigator navigator = ComponentUtility.getNavigator(OseeDisplayOptionsComponentImpl.this);
- SearchPresenter<?, ?> presenter = ComponentUtility.getPresenter(OseeDisplayOptionsComponentImpl.this);
- if (presenter != null) {
- presenter.selectDisplayOptions(url, options, navigator);
- } else {
- System.out.println("Presenter was null");
- }
- ComponentUtility.unlockForNavigateTo();
+ String url = ComponentUtility.getUrl(OseeDisplayOptionsComponentImpl.this);
+ SearchNavigator navigator = ComponentUtility.getNavigator(OseeDisplayOptionsComponentImpl.this);
+ SearchPresenter<?, ?> presenter = ComponentUtility.getPresenter(OseeDisplayOptionsComponentImpl.this);
+ if (presenter != null) {
+ presenter.selectDisplayOptions(url, options, navigator);
+ } else {
+ System.out.println("Presenter was null");
}
}
}