Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorspingel2008-06-13 10:27:07 +0000
committerspingel2008-06-13 10:27:07 +0000
commitb4996338b46ec9be20eddec644f74ccbc47bd42c (patch)
tree8a1b4007d8cd67d598802ec410a7b32215b22884 /org.eclipse.mylyn.trac.ui/src/org/eclipse
parent6e6c278e32df5acf18d6c4636f8e0b86fe15a9ee (diff)
downloadorg.eclipse.mylyn.tasks-b4996338b46ec9be20eddec644f74ccbc47bd42c.tar.gz
org.eclipse.mylyn.tasks-b4996338b46ec9be20eddec644f74ccbc47bd42c.tar.xz
org.eclipse.mylyn.tasks-b4996338b46ec9be20eddec644f74ccbc47bd42c.zip
NEW - bug 235011: port Trac to Mylyn 3.0 APIs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=235011
Diffstat (limited to 'org.eclipse.mylyn.trac.ui/src/org/eclipse')
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracConnectorUi.java55
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetector.java2
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracSearchHandler.java (renamed from org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracDuplicateDetector.java)34
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListFactory.java80
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java66
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracUiPlugin.java7
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/NewTracTaskEditor.java77
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracCcAttributeEditor.java87
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracPeoplePart.java106
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditor.java54
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorFactory.java101
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPage.java77
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracTaskEditorPageFactory.java74
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/EditTracQueryWizard.java58
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/NewTracQueryWizard.java64
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/NewTracTaskPage.java139
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracFilterQueryPage.java (renamed from org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryWizardPage.java)45
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracQueryPage.java (renamed from org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracCustomQueryPage.java)50
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/wizard/TracRepositorySettingsPage.java2
19 files changed, 495 insertions, 683 deletions
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracConnectorUi.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracConnectorUi.java
index af4e75053..a1bba5c70 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracConnectorUi.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracConnectorUi.java
@@ -18,22 +18,20 @@ import org.eclipse.jface.wizard.IWizard;
import org.eclipse.mylyn.internal.trac.core.ITracClient;
import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-import org.eclipse.mylyn.internal.trac.core.TracTask.Kind;
-import org.eclipse.mylyn.internal.trac.ui.wizard.EditTracQueryWizard;
-import org.eclipse.mylyn.internal.trac.ui.wizard.NewTracQueryWizard;
-import org.eclipse.mylyn.internal.trac.ui.wizard.TracCustomQueryPage;
+import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector.TaskKind;
+import org.eclipse.mylyn.internal.trac.ui.wizard.TracQueryPage;
import org.eclipse.mylyn.internal.trac.ui.wizard.TracRepositorySettingsPage;
import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.ITask;
import org.eclipse.mylyn.tasks.core.ITaskMapping;
import org.eclipse.mylyn.tasks.core.TaskRepository;
import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
+import org.eclipse.mylyn.tasks.ui.LegendElement;
import org.eclipse.mylyn.tasks.ui.wizards.ITaskRepositoryPage;
import org.eclipse.mylyn.tasks.ui.wizards.ITaskSearchPage;
import org.eclipse.mylyn.tasks.ui.wizards.NewTaskWizard;
import org.eclipse.mylyn.tasks.ui.wizards.NewWebTaskWizard;
+import org.eclipse.mylyn.tasks.ui.wizards.RepositoryQueryWizard;
/**
* @author Mik Kersten
@@ -41,6 +39,11 @@ import org.eclipse.mylyn.tasks.ui.wizards.NewWebTaskWizard;
*/
public class TracConnectorUi extends AbstractRepositoryConnectorUi {
+ @SuppressWarnings("restriction")
+ public TracConnectorUi() {
+ org.eclipse.mylyn.internal.tasks.ui.TasksUiPlugin.getDefault().addSearchHandler(new TracSearchHandler());
+ }
+
@Override
public IHyperlink[] findHyperlinks(TaskRepository repository, String text, int lineOffset, int regionOffset) {
return TracHyperlinkUtil.findTicketHyperlinks(repository, text, lineOffset, regionOffset);
@@ -58,7 +61,7 @@ public class TracConnectorUi extends AbstractRepositoryConnectorUi {
@Override
public ITaskSearchPage getSearchPage(TaskRepository repository, IStructuredSelection selection) {
- return new TracCustomQueryPage(repository);
+ return new TracQueryPage(repository);
}
@Override
@@ -78,47 +81,35 @@ public class TracConnectorUi extends AbstractRepositoryConnectorUi {
@Override
public IWizard getQueryWizard(TaskRepository repository, IRepositoryQuery query) {
- if (query instanceof TracRepositoryQuery) {
- return new EditTracQueryWizard(repository, query);
- } else {
- return new NewTracQueryWizard(repository);
- }
+ RepositoryQueryWizard wizard = new RepositoryQueryWizard(repository);
+ wizard.addPage(new TracQueryPage(repository, query));
+ return wizard;
}
@Override
public String getConnectorKind() {
- return TracCorePlugin.REPOSITORY_KIND;
+ return TracCorePlugin.CONNECTOR_KIND;
}
@Override
public ImageDescriptor getTaskKindOverlay(ITask task) {
- Kind kind = Kind.fromString(task.getTaskKind());
- if (kind == Kind.DEFECT) {
+ TaskKind taskKind = TaskKind.fromString(task.getTaskKind());
+ if (taskKind == TaskKind.DEFECT) {
return TracImages.OVERLAY_DEFECT;
- } else if (kind == Kind.ENHANCEMENT) {
+ } else if (taskKind == TaskKind.ENHANCEMENT) {
return TracImages.OVERLAY_ENHANCEMENT;
- } else if (kind == Kind.TASK) {
+ } else if (taskKind == TaskKind.TASK) {
return null;
}
return super.getTaskKindOverlay(task);
}
@Override
- public List<ITask> getLegendItems() {
- List<ITask> legendItems = new ArrayList<ITask>();
-
- TracTask defect = new TracTask("", Kind.DEFECT.name(), Kind.DEFECT.toString());
- defect.setTaskKind(Kind.DEFECT.toString());
- legendItems.add(defect);
-
- TracTask enhancement = new TracTask("", Kind.ENHANCEMENT.name(), Kind.ENHANCEMENT.toString());
- enhancement.setTaskKind(Kind.ENHANCEMENT.toString());
- legendItems.add(enhancement);
-
- TracTask task = new TracTask("", Kind.TASK.name(), Kind.TASK.toString());
- task.setTaskKind(Kind.TASK.toString());
- legendItems.add(task);
-
+ public List<LegendElement> getLegendElements() {
+ List<LegendElement> legendItems = new ArrayList<LegendElement>();
+ legendItems.add(LegendElement.createTask(TaskKind.DEFECT.toString(), TracImages.OVERLAY_DEFECT));
+ legendItems.add(LegendElement.createTask(TaskKind.ENHANCEMENT.toString(), TracImages.OVERLAY_ENHANCEMENT));
+ legendItems.add(LegendElement.createTask(TaskKind.TASK.toString(), null));
return legendItems;
}
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetector.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetector.java
index f4d10a8f1..d6c9e2173 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetector.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracHyperlinkDetector.java
@@ -27,7 +27,7 @@ public class TracHyperlinkDetector extends AbstractHyperlinkDetector {
public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
TaskRepository taskRepository = (TaskRepository) getAdapter(TaskRepository.class);
- if (taskRepository != null && TracCorePlugin.REPOSITORY_KIND.equals(taskRepository.getConnectorKind())) {
+ if (taskRepository != null && TracCorePlugin.CONNECTOR_KIND.equals(taskRepository.getConnectorKind())) {
IDocument document = textViewer.getDocument();
if (document == null) {
return null;
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracDuplicateDetector.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracSearchHandler.java
index 660f34e2d..77b03270b 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/TracDuplicateDetector.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracSearchHandler.java
@@ -6,41 +6,45 @@
* http://www.eclipse.org/legal/epl-v10.html
*******************************************************************************/
-package org.eclipse.mylyn.internal.trac.ui.editor;
+package org.eclipse.mylyn.internal.trac.ui;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyDuplicateDetector;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskData;
+import org.eclipse.mylyn.internal.tasks.core.AbstractSearchHandler;
import org.eclipse.mylyn.internal.trac.core.ITracClient;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
+import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
import org.eclipse.mylyn.internal.trac.core.model.TracSearch;
import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter;
import org.eclipse.mylyn.internal.trac.core.model.TracSearchFilter.CompareOperator;
+import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
import org.eclipse.mylyn.tasks.core.TaskRepository;
+import org.eclipse.mylyn.tasks.core.data.TaskData;
-public class TracDuplicateDetector extends AbstractLegacyDuplicateDetector {
+@SuppressWarnings("restriction")
+public class TracSearchHandler extends AbstractSearchHandler {
@Override
- public RepositoryQuery getDuplicatesQuery(TaskRepository repository, RepositoryTaskData taskData) {
+ public String getConnectorKind() {
+ return TracCorePlugin.CONNECTOR_KIND;
+ }
+
+ @Override
+ public boolean queryForText(TaskRepository taskRepository, IRepositoryQuery query, TaskData taskData,
+ String searchString) {
TracSearchFilter filter = new TracSearchFilter("description");
filter.setOperator(CompareOperator.CONTAINS);
-
- String searchString = AbstractLegacyDuplicateDetector.getStackTraceFromDescription(taskData.getDescription());
-
filter.addValue(searchString);
TracSearch search = new TracSearch();
search.addFilter(filter);
- // TODO copied from TracCustomQueryPage.getQueryUrl()
+ // TODO copied from TracQueryPage.getQueryUrl()
StringBuilder sb = new StringBuilder();
- sb.append(repository.getRepositoryUrl());
+ sb.append(taskRepository.getRepositoryUrl());
sb.append(ITracClient.QUERY_URL);
sb.append(search.toUrl());
- TracRepositoryQuery query = new TracRepositoryQuery(repository.getRepositoryUrl(), sb.toString(),
- "<Duplicate Search>");
- return query;
+ query.setUrl(sb.toString());
+
+ return true;
}
}
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListFactory.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListFactory.java
deleted file mode 100644
index 9d8d51740..000000000
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListFactory.java
+++ /dev/null
@@ -1,80 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Mylyn project committers and others.
- * 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.trac.ui;
-
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.mylyn.internal.tasks.core.AbstractTask;
-import org.eclipse.mylyn.internal.tasks.core.RepositoryQuery;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractTaskListFactory;
-import org.eclipse.mylyn.internal.trac.core.TracRepositoryQuery;
-import org.eclipse.mylyn.internal.trac.core.TracTask;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.ITask;
-import org.w3c.dom.Element;
-
-/**
- * @author Steffen Pingel
- * @author Mik Kersten
- */
-public class TracTaskListFactory extends AbstractTaskListFactory {
-
- private static final String KEY_TRAC = "Trac";
-
- private static final String KEY_TRAC_TASK = KEY_TRAC + AbstractTaskListFactory.KEY_TASK;
-
- private static final String KEY_TRAC_QUERY = KEY_TRAC + AbstractTaskListFactory.KEY_QUERY;
-
- private static final String KEY_SUPPORTS_SUBTASKS = "SupportsSubtasks";
-
- @Override
- public String getTaskElementName() {
- return KEY_TRAC_TASK;
- }
-
- @Override
- public Set<String> getQueryElementNames() {
- Set<String> names = new HashSet<String>();
- names.add(KEY_TRAC_QUERY);
- return names;
- }
-
- @Override
- public boolean canCreate(ITask task) {
- return task instanceof TracTask;
- }
-
- @Override
- public boolean canCreate(IRepositoryQuery category) {
- return category instanceof TracRepositoryQuery;
- }
-
- @Override
- public String getQueryElementName(IRepositoryQuery query) {
- return query instanceof TracRepositoryQuery ? KEY_TRAC_QUERY : "";
- }
-
- @Override
- public AbstractTask createTask(String repositoryUrl, String taskId, String summary, Element element) {
- boolean supportsSubtasks = false;
- if (element.hasAttribute(KEY_SUPPORTS_SUBTASKS)) {
- supportsSubtasks = Boolean.valueOf(element.getAttribute(KEY_SUPPORTS_SUBTASKS));
- }
-
- TracTask task = new TracTask(repositoryUrl, taskId, summary);
- task.setSupportsSubtasks(supportsSubtasks);
- return task;
- }
-
- @Override
- public RepositoryQuery createQuery(String repositoryUrl, String queryString, String label, Element element) {
- return new TracRepositoryQuery(repositoryUrl, queryString, label);
- }
-}
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java
new file mode 100644
index 000000000..c34921414
--- /dev/null
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracTaskListMigrator.java
@@ -0,0 +1,66 @@
+/*******************************************************************************
+ * Copyright (c) 2004, 2007 Mylyn project committers and others.
+ * 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
+ *******************************************************************************/
+
+package org.eclipse.mylyn.internal.trac.ui;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import org.eclipse.mylyn.internal.trac.core.TracCorePlugin;
+import org.eclipse.mylyn.internal.trac.core.TracRepositoryConnector;
+import org.eclipse.mylyn.internal.trac.core.util.TracUtils;
+import org.eclipse.mylyn.tasks.core.AbstractTaskListMigrator;
+import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
+import org.eclipse.mylyn.tasks.core.ITask;
+import org.w3c.dom.Element;
+
+/**
+ * @author Steffen Pingel
+ */
+public class TracTaskListMigrator extends AbstractTaskListMigrator {
+
+ private static final String KEY_TRAC = "Trac";
+
+ private static final String KEY_TRAC_TASK = KEY_TRAC + KEY_TASK;
+
+ private static final String KEY_TRAC_QUERY = KEY_TRAC + KEY_QUERY;
+
+ private static final String KEY_SUPPORTS_SUBTASKS = "SupportsSubtasks";
+
+ @Override
+ public String getConnectorKind() {
+ return TracCorePlugin.CONNECTOR_KIND;
+ }
+
+ @Override
+ public String getTaskElementName() {
+ return KEY_TRAC_TASK;
+ }
+
+ @Override
+ public Set<String> getQueryElementNames() {
+ Set<String> names = new HashSet<String>();
+ names.add(KEY_TRAC_QUERY);
+ return names;
+ }
+
+ @Override
+ public void migrateQuery(IRepositoryQuery query, Element element) {
+ // nothing to do
+ }
+
+ @Override
+ public void migrateTask(ITask task, Element element) {
+ task.setModificationDate(TracUtils.parseDate(element.getAttribute(KEY_LAST_MOD_DATE)));
+ if (element.hasAttribute(KEY_SUPPORTS_SUBTASKS)) {
+ task.setAttribute(TracRepositoryConnector.TASK_KEY_SUPPORTS_SUBTASKS, Boolean.valueOf(
+ element.getAttribute(KEY_SUPPORTS_SUBTASKS)).toString());
+ }
+ }
+
+}
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracUiPlugin.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracUiPlugin.java
index 6790a10d4..dc5f42f0f 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracUiPlugin.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracUiPlugin.java
@@ -21,10 +21,6 @@ public class TracUiPlugin extends AbstractUIPlugin {
public static final String ID_PLUGIN = "org.eclipse.mylyn.trac.ui";
- public final static String TITLE_MESSAGE_DIALOG = "Mylyn Trac Client";
-
- public static final String NEW_BUG_EDITOR_ID = ID_PLUGIN + ".newBugEditor";
-
private static TracUiPlugin plugin;
public TracUiPlugin() {
@@ -42,8 +38,7 @@ public class TracUiPlugin extends AbstractUIPlugin {
@Override
public void stop(BundleContext context) throws Exception {
- TasksUi.getRepositoryManager().removeListener(
- TracCorePlugin.getDefault().getConnector().getClientManager());
+ TasksUi.getRepositoryManager().removeListener(TracCorePlugin.getDefault().getConnector().getClientManager());
plugin = null;
super.stop(context);
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/NewTracTaskEditor.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/NewTracTaskEditor.java
deleted file mode 100644
index 2c010b438..000000000
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/editor/NewTracTaskEditor.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004, 2007 Mylyn project committers and others.
- * 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
- *******************************************************************************/
-
-package org.eclipse.mylyn.internal.trac.ui.editor;
-
-import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.viewers.ILabelProvider;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.AbstractLegacyDuplicateDetector;
-import org.eclipse.mylyn.internal.tasks.core.deprecated.RepositoryTaskAttribute;
-import org.eclipse.mylyn.internal.tasks.ui.deprecated.AbstractNewRepositoryTaskEditor;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
-import org.eclipse.ui.forms.editor.FormEditor;
-import org.eclipse.ui.forms.widgets.FormToolkit;
-import org.eclipse.ui.forms.widgets.Section;
-
-/**
- * @author Steffen Pingel
- */
-public class NewTracTaskEditor extends AbstractNewRepositoryTaskEditor {
-
- public NewTracTaskEditor(FormEditor editor) {
- super(editor);
- }
-
- @Override
- public AbstractLegacyDuplicateDetector getDuplicateDetector(String name) {
- return new TracDuplicateDetector();
- }
-
- @Override
- protected void createPeopleLayout(Composite composite) {
- FormToolkit toolkit = getManagedForm().getToolkit();
- Section peopleSection = createSection(composite, getSectionLabel(SECTION_NAME.PEOPLE_SECTION));
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(peopleSection);
- Composite peopleComposite = toolkit.createComposite(peopleSection);
- GridLayout layout = new GridLayout(2, false);
- layout.marginRight = 5;
- peopleComposite.setLayout(layout);
- GridDataFactory.fillDefaults().align(SWT.FILL, SWT.FILL).grab(true, true).applyTo(peopleComposite);
-
- Label label = toolkit.createLabel(peopleComposite, "Assign to:");
- GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label);
- Composite textFieldComposite = toolkit.createComposite(peopleComposite);
- GridDataFactory.fillDefaults().grab(true, false).applyTo(textFieldComposite);
- GridLayout textLayout = new GridLayout();
- textFieldComposite.setLayout(textLayout);
-
- RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.USER_ASSIGNED);
-
- Text textField = createTextField(textFieldComposite, attribute, SWT.FLAT);
- toolkit.paintBordersFor(textFieldComposite);
- GridDataFactory.fillDefaults().grab(true, false).applyTo(textField);
- peopleSection.setClient(peopleComposite);
-
- ContentAssistCommandAdapter adapter = applyContentAssist(textField, createContentProposalProvider(attribute));
-
- ILabelProvider propsalLabelProvider = createProposalLabelProvider(attribute);
- if (propsalLabelProvider != null) {
- adapter.setLabelProvider(propsalLabelProvider);
- }
- adapter.setProposalAcceptanceStyle(ContentProposalAdapter.PROPOS