Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java3
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java33
2 files changed, 25 insertions, 11 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
index af93ef9e3..f8914cac8 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/search/BugzillaSearchPage.java
@@ -2477,6 +2477,7 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
super(Messages.BugzillaSearchPage_Bugzilla_Query, repository, null);
toolkit = new FormToolkit(Display.getCurrent());
+ setNeedsClearButton(true);
setMessage(Messages.BugzillaSearchPage_Enter_search_option);
BugzillaRepositoryConnector connector = (BugzillaRepositoryConnector) TasksUi.getRepositoryConnector(getTaskRepository().getConnectorKind());
repositoryConfiguration = connector.getRepositoryConfiguration(getTaskRepository().getUrl());
@@ -2485,7 +2486,7 @@ public class BugzillaSearchPage extends AbstractRepositoryQueryPage2 implements
public BugzillaSearchPage(TaskRepository repository, IRepositoryQuery origQuery) {
super(Messages.BugzillaSearchPage_Bugzilla_Query, repository, origQuery);
originalQuery = origQuery;
-
+ setNeedsClearButton(true);
setDescription(Messages.BugzillaSearchPage_Select_the_Bugzilla_query_parameters);
setMessage(Messages.BugzillaSearchPage_Enter_search_option);
toolkit = new FormToolkit(Display.getCurrent());
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java
index ca37a4df5..cb1e44035 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/provisional/tasks/ui/wizards/AbstractRepositoryQueryPage2.java
@@ -57,6 +57,8 @@ public abstract class AbstractRepositoryQueryPage2 extends AbstractRepositoryQue
private boolean needsRepositoryConfiguration = true;
+ private boolean needsClearButton = false;
+
public AbstractRepositoryQueryPage2(String pageName, TaskRepository repository, IRepositoryQuery query) {
super(pageName, repository, query);
this.connector = TasksUi.getRepositoryConnector(getTaskRepository().getConnectorKind());
@@ -67,6 +69,10 @@ public abstract class AbstractRepositoryQueryPage2 extends AbstractRepositoryQue
this.needsRepositoryConfiguration = needsRepositoryConfiguration;
}
+ public void setNeedsClearButton(boolean needsClearButton) {
+ this.needsClearButton = needsClearButton;
+ }
+
public void createControl(Composite parent) {
Composite composite = new Composite(parent, SWT.NONE);
GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(composite);
@@ -129,16 +135,21 @@ public abstract class AbstractRepositoryQueryPage2 extends AbstractRepositoryQue
}
protected void createButtons(final Composite control) {
- Button clearButton = new Button(control, SWT.PUSH);
- clearButton.setText(Messages.AbstractRepositoryQueryPage2_Clear_Fields);
- clearButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
- clearButton.addSelectionListener(new SelectionAdapter() {
- @Override
- public void widgetSelected(SelectionEvent e) {
- clearFields();
- }
+ if (getSearchContainer() == null) {
+ return;
+ }
+ if (needsClearButton) {
+ Button clearButton = new Button(control, SWT.PUSH);
+ clearButton.setText(Messages.AbstractRepositoryQueryPage2_Clear_Fields);
+ clearButton.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, false));
+ clearButton.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ clearFields();
+ }
- });
+ });
+ }
if (needsRepositoryConfiguration) {
updateButton = new Button(control, SWT.PUSH);
updateButton.setText(Messages.AbstractRepositoryQueryPage2__Refresh_From_Repository);
@@ -319,5 +330,7 @@ public abstract class AbstractRepositoryQueryPage2 extends AbstractRepositoryQue
return false;
}
- abstract public void clearFields();
+ public void clearFields() {
+
+ }
}

Back to the top