Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrelves2007-02-16 17:02:52 -0500
committerrelves2007-02-16 17:02:52 -0500
commitaaab85ecf42b9da45a7e602fbb7cfdac4b2371cd (patch)
tree3705b29a89860ff4fd0f1aca78a62bc4c5ecdbfc
parentac26f704999be2a33e6034fa6fdbce85e0ef514b (diff)
downloadorg.eclipse.mylyn.tasks-aaab85ecf42b9da45a7e602fbb7cfdac4b2371cd.tar.gz
org.eclipse.mylyn.tasks-aaab85ecf42b9da45a7e602fbb7cfdac4b2371cd.tar.xz
org.eclipse.mylyn.tasks-aaab85ecf42b9da45a7e602fbb7cfdac4b2371cd.zip
NEW - bug 158921: improve task editor information density
https://bugs.eclipse.org/bugs/show_bug.cgi?id=158921
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryUi.java5
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java127
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java10
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java78
-rw-r--r--org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java5
5 files changed, 119 insertions, 106 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryUi.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryUi.java
index a11577c02..d5a7e51eb 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryUi.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/tasklist/BugzillaRepositoryUi.java
@@ -18,6 +18,7 @@ import org.eclipse.mylar.internal.bugzilla.core.BugzillaRepositoryQuery;
import org.eclipse.mylar.internal.bugzilla.ui.search.BugzillaSearchPage;
import org.eclipse.mylar.internal.bugzilla.ui.wizard.NewBugzillaTaskWizard;
import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylar.tasks.ui.search.AbstractRepositoryQueryPage;
@@ -29,6 +30,10 @@ import org.eclipse.mylar.tasks.ui.wizards.AbstractRepositorySettingsPage;
*/
public class BugzillaRepositoryUi extends AbstractRepositoryConnectorUi {
+ public String getTaskKindLabel(AbstractRepositoryTask repositoryTask) {
+ return "Bug";
+ }
+
@Override
public AbstractRepositorySettingsPage getSettingsPage() {
return new BugzillaRepositorySettingsPage(this);
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
index 1b2ad2dce..a569dcb33 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java
@@ -88,7 +88,7 @@ public class TaskPlanningEditor extends TaskFormPage {
private static final String NO_TIME_ELAPSED = "0 seconds";
- private static final String LABEL_OVERVIEW = "Task Info";
+// private static final String LABEL_OVERVIEW = "Task Info";
private static final String LABEL_NOTES = "Notes";
@@ -286,7 +286,6 @@ public class TaskPlanningEditor extends TaskFormPage {
form = managedForm.getForm();
toolkit = managedForm.getToolkit();
- form.setText(task.getSummary());
form.setImage(TaskListImages.getImage(TaskListImages.CALENDAR));
toolkit.decorateFormHeading(form.getForm());
@@ -294,8 +293,11 @@ public class TaskPlanningEditor extends TaskFormPage {
editorComposite.setLayout(new GridLayout());
editorComposite.setLayoutData(new GridData(GridData.FILL_BOTH));
// try {
- if (!(task instanceof AbstractRepositoryTask)) {
+ if (task instanceof AbstractRepositoryTask) {
+ form.setText("Planning");
+ } else {
createSummarySection(editorComposite);
+ form.setText("Task: " + task.getSummary());
}
createPlanningSection(editorComposite);
createNotesSection(editorComposite);
@@ -321,35 +323,17 @@ public class TaskPlanningEditor extends TaskFormPage {
}
private void createSummarySection(Composite parent) {
- Section section = toolkit.createSection(parent, ExpandableComposite.TITLE_BAR | Section.TWISTIE);
- section.setText(LABEL_OVERVIEW);
- section.setExpanded(true);
-
- section.setLayout(new GridLayout());
- section.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- section.addExpansionListener(new IExpansionListener() {
- public void expansionStateChanging(ExpansionEvent e) {
- form.reflow(true);
- }
-
- public void expansionStateChanged(ExpansionEvent e) {
- form.reflow(true);
- }
- });
-
- Composite container = toolkit.createComposite(section);
- section.setClient(container);
+ Composite container = toolkit.createComposite(parent);
GridLayout compLayout = new GridLayout();
compLayout.numColumns = 2;
container.setLayout(compLayout);
container.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- toolkit.createLabel(container, "Summary: ");
-// l.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
summary = toolkit.createText(container, task.getSummary(), SWT.NONE);
summary.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
- summary.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
+ GridData summaryGridData = new GridData(GridData.FILL_HORIZONTAL);
+ summaryGridData.horizontalSpan = 2;
+ summary.setLayoutData(summaryGridData);
toolkit.paintBordersFor(container);
if (task instanceof AbstractRepositoryTask) {
@@ -362,59 +346,9 @@ public class TaskPlanningEditor extends TaskFormPage {
});
}
- toolkit.createLabel(container, "Web Link:");
-// urlLabel.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
-
- Composite urlComposite = toolkit.createComposite(container);
- GridLayout urlLayout = new GridLayout(2, false);
- urlLayout.marginWidth = 1;
- urlComposite.setLayout(urlLayout);
- GridData urlGridData = new GridData(GridData.FILL_HORIZONTAL);
- urlComposite.setLayoutData(urlGridData);
-
- issueReportURL = toolkit.createText(urlComposite, task.getTaskUrl(), SWT.NONE);
- GridData gridLayout = new GridData(GridData.FILL_HORIZONTAL);
- issueReportURL.setLayoutData(gridLayout);
-
- if (task instanceof AbstractRepositoryTask) {
- issueReportURL.setEditable(false);
- } else {
- issueReportURL.addModifyListener(new ModifyListener() {
- public void modifyText(ModifyEvent e) {
- markDirty(true);
- }
- });
- }
-
- getDescButton = toolkit.createButton(urlComposite, "Get Description", SWT.PUSH);
- getDescButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
- toolkit.paintBordersFor(urlComposite);
- setButtonStatus();
-
- issueReportURL.addKeyListener(new KeyListener() {
- public void keyPressed(KeyEvent e) {
- setButtonStatus();
- }
-
- public void keyReleased(KeyEvent e) {
- setButtonStatus();
- }
- });
-
- getDescButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- retrieveTaskDescription(issueReportURL.getText());
- }
-
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
-
toolkit.createLabel(container, "Status:");
-// label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
-
Composite statusComposite = toolkit.createComposite(container);
- statusComposite.setLayout(new GridLayout(2, false));
+ statusComposite.setLayout(new GridLayout(6, false));
priorityCombo = new Combo(statusComposite, SWT.READ_ONLY);
@@ -475,6 +409,47 @@ public class TaskPlanningEditor extends TaskFormPage {
}
});
}
+
+ toolkit.createLabel(statusComposite, "URL:");
+ issueReportURL = toolkit.createText(statusComposite, task.getTaskUrl(), SWT.NONE);
+ GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).grab(true, false).applyTo(issueReportURL);
+// GridData gridLayout = new GridData(GridData.FILL_HORIZONTAL);
+// gridLayout.grabExcessVerticalSpace = true;
+// issueReportURL.setLayoutData(gridLayout);
+
+ if (task instanceof AbstractRepositoryTask) {
+ issueReportURL.setEditable(false);
+ } else {
+ issueReportURL.addModifyListener(new ModifyListener() {
+ public void modifyText(ModifyEvent e) {
+ markDirty(true);
+ }
+ });
+ }
+
+ getDescButton = toolkit.createButton(statusComposite, "Get Description", SWT.PUSH);
+ getDescButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_END));
+ toolkit.paintBordersFor(container);
+ setButtonStatus();
+
+ issueReportURL.addKeyListener(new KeyListener() {
+ public void keyPressed(KeyEvent e) {
+ setButtonStatus();
+ }
+
+ public void keyReleased(KeyEvent e) {
+ setButtonStatus();
+ }
+ });
+
+ getDescButton.addSelectionListener(new SelectionListener() {
+ public void widgetSelected(SelectionEvent e) {
+ retrieveTaskDescription(issueReportURL.getText());
+ }
+
+ public void widgetDefaultSelected(SelectionEvent e) {
+ }
+ });
}
/**
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
index 970301d4e..a528a3ad5 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/AbstractRepositoryConnectorUi.java
@@ -17,6 +17,7 @@ import org.eclipse.mylar.core.MylarStatusHandler;
import org.eclipse.mylar.internal.tasks.ui.wizards.CommonAddExistingTaskWizard;
import org.eclipse.mylar.tasks.core.AbstractRepositoryConnector;
import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.core.TaskRepositoryManager;
import org.eclipse.mylar.tasks.ui.wizards.AbstractRepositorySettingsPage;
@@ -33,6 +34,8 @@ import org.eclipse.ui.PlatformUI;
*/
public abstract class AbstractRepositoryConnectorUi {
+ private static final String LABEL_TASK_DEFAULT = "Task";
+
/**
* @return the unique type of the repository, e.g. "bugzilla"
*/
@@ -52,6 +55,13 @@ public abstract class AbstractRepositoryConnectorUi {
public abstract boolean hasSearchPage();
+ /**
+ * @param repositoryTask can be null
+ */
+ public String getTaskKindLabel(AbstractRepositoryTask repositoryTask) {
+ return LABEL_TASK_DEFAULT;
+ }
+
public void openEditQueryDialog(AbstractRepositoryQuery query) {
try {
TaskRepository repository = TasksUiPlugin.getRepositoryManager().getRepository(query.getRepositoryKind(),
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
index 9a7c401ae..ae7166886 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java
@@ -95,6 +95,7 @@ import org.eclipse.mylar.tasks.core.RepositoryTaskData;
import org.eclipse.mylar.tasks.core.TaskComment;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.core.AbstractRepositoryTask.RepositoryTaskSyncState;
+import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylar.tasks.ui.TasksUiPlugin;
import org.eclipse.mylar.tasks.ui.TasksUiUtil;
import org.eclipse.swt.SWT;
@@ -668,6 +669,9 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
return addCommentsTextBox.getText();
}
+ /**
+ *
+ */
protected void createFormContent(final IManagedForm managedForm) {
IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager();
backgroundIncoming = themeManager.getCurrentTheme().getColorRegistry().get(
@@ -678,6 +682,20 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
toolkit = managedForm.getToolkit();
registerDropListener(form);
+ form.setImage(TaskListImages.getImage(TaskListImages.REPOSITORY));
+
+ AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getRepositoryUi(repository.getKind());
+ String kindLabel = connectorUi.getTaskKindLabel(repositoryTask);
+ String idLabel = "";
+ if (repositoryTask != null) {
+ idLabel = repositoryTask.getIdentifyingLabel();
+ } else {
+ idLabel = taskData.getId();
+ }
+
+ form.setText(kindLabel + ": " + idLabel);
+ toolkit.decorateFormHeading(form.getForm());
+
editorComposite = form.getBody();
GridLayout editorLayout = new GridLayout();
editorComposite.setLayout(editorLayout);
@@ -732,7 +750,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
addSummaryText(composite);
Composite headerInfoComposite = toolkit.createComposite(composite);
- GridLayout headerLayout = new GridLayout(10, false);
+ GridLayout headerLayout = new GridLayout(11, false);
headerLayout.verticalSpacing = 1;
headerLayout.marginHeight = 1;
headerLayout.horizontalSpacing = 2;
@@ -740,20 +758,20 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
RepositoryTaskAttribute statusAtribute = taskData.getAttribute(RepositoryTaskAttribute.STATUS);
if (statusAtribute != null) {
- createLabel(headerInfoComposite, statusAtribute).setFont(TITLE_FONT);
+ createLabel(headerInfoComposite, statusAtribute);//.setFont(TITLE_FONT);
createTextField(headerInfoComposite, statusAtribute, SWT.FLAT | SWT.READ_ONLY);
}
RepositoryTaskAttribute priorityAttribute = taskData.getAttribute(RepositoryTaskAttribute.PRIORITY);
if (priorityAttribute != null) {
- createLabel(headerInfoComposite, priorityAttribute).setFont(TITLE_FONT);
+ createLabel(headerInfoComposite, priorityAttribute);//.setFont(TITLE_FONT);
createTextField(headerInfoComposite, priorityAttribute, SWT.FLAT | SWT.READ_ONLY);
}
- String id = (repositoryTask != null) ? repositoryTask.getIdentifyingLabel() : taskData.getId();
- if (id != null) {
- toolkit.createLabel(headerInfoComposite, " ID: ").setFont(TITLE_FONT);
- toolkit.createText(headerInfoComposite, id, SWT.FLAT | SWT.READ_ONLY);
+ String idLabel = (repositoryTask != null) ? repositoryTask.getIdentifyingLabel() : taskData.getId();
+ if (idLabel != null) {
+ toolkit.createLabel(headerInfoComposite, "ID");//.setFont(TITLE_FONT);
+ toolkit.createText(headerInfoComposite, idLabel, SWT.FLAT | SWT.READ_ONLY);
}
String openedDateString = "";
@@ -771,15 +789,29 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
RepositoryTaskAttribute creationAttribute = taskData.getAttribute(RepositoryTaskAttribute.DATE_CREATION);
if (creationAttribute != null) {
- createLabel(headerInfoComposite, creationAttribute).setFont(TITLE_FONT);
+ createLabel(headerInfoComposite, creationAttribute);//.setFont(TITLE_FONT);
toolkit.createText(headerInfoComposite, openedDateString, SWT.FLAT | SWT.READ_ONLY);
}
RepositoryTaskAttribute modifiedAttribute = taskData.getAttribute(RepositoryTaskAttribute.DATE_MODIFIED);
if (modifiedAttribute != null) {
- createLabel(headerInfoComposite, modifiedAttribute).setFont(TITLE_FONT);
+ createLabel(headerInfoComposite, modifiedAttribute);//.setFont(TITLE_FONT);
toolkit.createText(headerInfoComposite, modifiedDateString, SWT.FLAT | SWT.READ_ONLY);
}
+
+ if (getActivityUrl() != null) {
+ Hyperlink hyperlink = toolkit.createHyperlink(headerInfoComposite, "Past activity", SWT.NONE);
+ hyperlink.addHyperlinkListener(new HyperlinkAdapter() {
+ @Override
+ public void linkActivated(HyperlinkEvent e) {
+ if (AbstractRepositoryTaskEditor.this.getEditor() instanceof TaskEditor) {
+ TaskEditor mylarTaskEditor = (TaskEditor) AbstractRepositoryTaskEditor.this.getEditor();
+ mylarTaskEditor.displayInBrowser(getActivityUrl());
+ }
+ }
+ });
+// GridDataFactory.fillDefaults().span(1, SWT.DEFAULT).align(SWT.RIGHT, SWT.DEFAULT).applyTo(hyperlink);
+ }
}
/**
@@ -967,8 +999,8 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
RepositoryTaskAttribute attribute = taskData.getAttribute(RepositoryTaskAttribute.SUMMARY);
if (attribute != null) {
- Label summaryLabel = createLabel(summaryComposite, attribute);
- summaryLabel.setFont(TITLE_FONT);
+// Label summaryLabel = createLabel(summaryComposite, attribute);
+// summaryLabel.setFont(TITLE_FONT);
summaryText = createTextField(summaryComposite, attribute, SWT.FLAT);
IThemeManager themeManager = getSite().getWorkbenchWindow().getWorkbench().getThemeManager();
Font summaryFont = themeManager.getCurrentTheme().getFontRegistry().get(
@@ -1850,13 +1882,9 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
* Composite to add the buttons to.
*/
protected void addActionButtons(Composite buttonComposite) {
- ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskData.getId());
- if (attachContext && task != null) {
- addAttachContextButton(buttonComposite, task);
- }
submitButton = toolkit.createButton(buttonComposite, LABEL_BUTTON_SUBMIT, SWT.NONE);
GridData submitButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- submitButtonData.horizontalSpan = 3;
+ submitButtonData.horizontalSpan = 1;
submitButtonData.widthHint = 100;
submitButton.setLayoutData(submitButtonData);
submitButton.addListener(SWT.Selection, new Listener() {
@@ -1865,20 +1893,10 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
}
});
submitButton.setToolTipText("Submit to " + this.repository.getUrl());
-
- // toolkit.createLabel(buttonComposite, "");
- if (getActivityUrl() != null) {
- Hyperlink hyperlink = toolkit.createHyperlink(buttonComposite, "View past activity", SWT.NONE);
- hyperlink.addHyperlinkListener(new HyperlinkAdapter() {
- @Override
- public void linkActivated(HyperlinkEvent e) {
- if (AbstractRepositoryTaskEditor.this.getEditor() instanceof TaskEditor) {
- TaskEditor mylarTaskEditor = (TaskEditor) AbstractRepositoryTaskEditor.this.getEditor();
- mylarTaskEditor.displayInBrowser(getActivityUrl());
- }
- }
- });
- GridDataFactory.fillDefaults().span(2, SWT.DEFAULT).align(SWT.RIGHT, SWT.DEFAULT).applyTo(hyperlink);
+
+ ITask task = TasksUiPlugin.getTaskListManager().getTaskList().getTask(repository.getUrl(), taskData.getId());
+ if (attachContext && task != null) {
+ addAttachContextButton(buttonComposite, task);
}
}
diff --git a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java
index e7a46d5a5..1dfeb4bf2 100644
--- a/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java
+++ b/org.eclipse.mylyn.trac.ui/src/org/eclipse/mylyn/internal/trac/ui/TracRepositoryUi.java
@@ -21,6 +21,7 @@ import org.eclipse.mylar.internal.trac.ui.wizard.NewTracTaskWizard;
import org.eclipse.mylar.internal.trac.ui.wizard.TracCustomQueryPage;
import org.eclipse.mylar.internal.trac.ui.wizard.TracRepositorySettingsPage;
import org.eclipse.mylar.tasks.core.AbstractRepositoryQuery;
+import org.eclipse.mylar.tasks.core.AbstractRepositoryTask;
import org.eclipse.mylar.tasks.core.TaskRepository;
import org.eclipse.mylar.tasks.ui.AbstractRepositoryConnectorUi;
import org.eclipse.mylar.tasks.ui.wizards.AbstractRepositorySettingsPage;
@@ -32,6 +33,10 @@ import org.eclipse.mylar.tasks.ui.wizards.NewWebTaskWizard;
*/
public class TracRepositoryUi extends AbstractRepositoryConnectorUi {
+ public String getTaskKindLabel(AbstractRepositoryTask repositoryTask) {
+ return "Ticket";
+ }
+
@Override
public AbstractRepositorySettingsPage getSettingsPage() {
return new TracRepositorySettingsPage(this);

Back to the top