Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormkersten2007-06-26 23:07:52 -0400
committermkersten2007-06-26 23:07:52 -0400
commit78db5eb543173671adb726b36d4bb738e7e98077 (patch)
treed726899c01f999a76dab5bcceda0bb6f0f32c49a
parent364baaaf31117ca09250e9becd95c92bf8f8f9d8 (diff)
downloadorg.eclipse.mylyn.tasks-78db5eb543173671adb726b36d4bb738e7e98077.tar.gz
org.eclipse.mylyn.tasks-78db5eb543173671adb726b36d4bb738e7e98077.tar.xz
org.eclipse.mylyn.tasks-78db5eb543173671adb726b36d4bb738e7e98077.zip
Version update
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java6
-rw-r--r--org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF1
-rw-r--r--org.eclipse.mylyn.tasks.ui/plugin.xml49
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java358
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ToggleWorkingSetAction.java2
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java115
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskPlanningEditor.java24
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java114
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/DatePickerPanel.java320
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java61
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java15
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java51
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/AbstractRepositoryTaskEditor.java53
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java202
-rw-r--r--org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java41
18 files changed, 479 insertions, 939 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java
index 3a30b8f51..57e84fdaf 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/internal/bugzilla/ui/editor/BugzillaTaskEditor.java
@@ -50,7 +50,7 @@ import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Text;
-import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
@@ -418,7 +418,7 @@ public class BugzillaTaskEditor extends AbstractRepositoryTaskEditor {
}
Label label = toolkit.createLabel(timeComposite, "Current Estimate:");
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
Text currentEstimate = toolkit.createText(
timeComposite,
@@ -587,7 +587,7 @@ public class BugzillaTaskEditor extends AbstractRepositoryTaskEditor {
protected void addVoting(Composite attributesComposite) {
Label label = getManagedForm().getToolkit().createLabel(attributesComposite, "Votes:");
- label.setForeground(getManagedForm().getToolkit().getColors().getColor(IFormColors.TITLE));
+ label.setForeground(getManagedForm().getToolkit().getColors().getColor(FormColors.TITLE));
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label);
Composite votingComposite = getManagedForm().getToolkit().createComposite(attributesComposite);
GridLayout layout = new GridLayout(3, false);
diff --git a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
index ad0c1dc7f..7f2f2eec1 100644
--- a/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.tasks.ui/META-INF/MANIFEST.MF
@@ -21,7 +21,6 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.ui.ide,
org.eclipse.search,
org.eclipse.mylyn,
- org.eclipse.ui.net,
org.eclipse.mylyn.web.core
Eclipse-AutoStart: true
Bundle-Vendor: Eclipse.org
diff --git a/org.eclipse.mylyn.tasks.ui/plugin.xml b/org.eclipse.mylyn.tasks.ui/plugin.xml
index f2dd46746..a23b34ee0 100644
--- a/org.eclipse.mylyn.tasks.ui/plugin.xml
+++ b/org.eclipse.mylyn.tasks.ui/plugin.xml
@@ -175,7 +175,6 @@
<view
closeable="true"
id="org.eclipse.mylyn.tasks.ui.views.tasks"
- minimized="false"
moveable="true"
ratio="0.5"
relationship="top"
@@ -200,7 +199,6 @@
<view
closeable="true"
id="org.eclipse.mylyn.tasks.ui.views.tasks"
- minimized="false"
relationship="stack"
relative="org.eclipse.ui.views.ContentOutline">
</view>
@@ -224,7 +222,6 @@
<perspectiveExtension targetID="org.eclipse.team.cvs.ui.cvsPerspective">
<view
id="org.eclipse.mylyn.tasks.ui.views.repositories"
- minimized="false"
ratio="0.7"
relationship="bottom"
relative="org.eclipse.team.ccvs.ui.RepositoriesView"
@@ -234,7 +231,6 @@
<perspectiveExtension targetID="org.tigris.subversion.subclipse.ui.svnPerspective">
<view
id="org.eclipse.mylyn.tasks.ui.views.repositories"
- minimized="false"
ratio="0.7"
relationship="bottom"
relative="org.tigris.subversion.subclipse.ui.repository.RepositoriesView"
@@ -244,7 +240,6 @@
<perspectiveExtension targetID="org.eclipse.team.ui.TeamSynchronizingPerspective">
<view
id="org.eclipse.mylyn.tasks.ui.views.repositories"
- minimized="false"
ratio="0.7"
relationship="bottom"
relative="org.eclipse.team.sync.views.SynchronizeView"
@@ -601,20 +596,6 @@
menuPath="tasks"/>
</extension>
- <extension
- point="org.eclipse.mylyn.tasks.ui.editors">
- <hyperlinkDetector
- class="org.eclipse.mylyn.internal.tasks.ui.editors.TaskUrlHyperlinkDetector"
- id="org.eclipse.mylyn.tasks.ui.hyperlink.detector.url"/>
-
- </extension>
- <extension
- point="org.eclipse.mylyn.tasks.ui.editors">
- <hyperlinkDetector
- class="org.eclipse.mylyn.internal.tasks.ui.editors.TaskHyperlinkDetector"
- id="org.eclipse.mylyn.tasks.ui.hyperlink.detector.tasks"/>
- </extension>
-
<extension
point="org.eclipse.ui.actionSets">
<actionSet
@@ -787,36 +768,8 @@
</adapter>
</factory>
</extension>
-
- <extension
- point="org.eclipse.ui.workbench.texteditor.hyperlinkDetectors">
- <hyperlinkDetector
- class="org.eclipse.mylyn.internal.tasks.ui.editors.TaskHyperlinkDetector"
- id="org.eclipse.mylyn.tasks.ui.hyperlinks.detectors.task"
- name="Mylyn Tasks"
- targetId="org.eclipse.ui.DefaultTextEditor">
- </hyperlinkDetector>
- <hyperlinkDetector
- class="org.eclipse.mylyn.internal.tasks.ui.editors.TaskUrlHyperlinkDetector"
- description="Mylyn enabled URL hyperlink detector"
- id="org.eclipse.mylyn.tasks.ui.hyperlinks.detectors.url"
- name="Mylyn URLs"
- targetId="org.eclipse.ui.DefaultTextEditor">
- </hyperlinkDetector>
- </extension>
-
- <extension
- point="org.eclipse.ui.workingSets">
- <workingSet
- elementAdapterClass="org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetElementAdapter"
- icon="icons/obj16/workingSet.gif"
- id="org.eclipse.mylyn.tasks.ui.workingSet"
- name="Tasks and Resources"
- pageClass="org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetPage"
- updaterClass="org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetUpdater"/>
- </extension>
- <extension point="org.eclipse.core.runtime.adapters">
+ <extension point="org.eclipse.core.runtime.adapters">
<factory
adaptableType="org.eclipse.mylyn.tasks.core.AbstractTaskContainer"
class="org.eclipse.mylyn.internal.tasks.ui.workingsets.TaskWorkingSetAdapterFactory">
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java
index 6886afa58..3b1cd8d9e 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListHyperlink.java
@@ -24,7 +24,7 @@ public class TaskListHyperlink extends Hyperlink {
}
// From PerspectiveBarContributionItem
- @Override
+// @Override
protected String shortenText(GC gc, String t, int width) {
if (t == null) {
return null;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java
index 6eb3c7683..e8953eae7 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskListImageHyperlink.java
@@ -24,7 +24,7 @@ public class TaskListImageHyperlink extends ImageHyperlink {
}
// From PerspectiveBarContributionItem
- @Override
+// @Override
protected String shortenText(GC gc, String t, int width) {
if (t == null) {
return null;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
deleted file mode 100644
index 5628a5eb7..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/TaskTrimWidget.java
+++ /dev/null
@@ -1,358 +0,0 @@
-package org.eclipse.mylyn.internal.tasks.ui;
-
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 Mylar 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
- *******************************************************************************/
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.jface.action.IMenuListener;
-import org.eclipse.jface.action.IMenuManager;
-import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.util.IPropertyChangeListener;
-import org.eclipse.jface.util.PropertyChangeEvent;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.jface.viewers.ISelectionChangedListener;
-import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.IStructuredSelection;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
-import org.eclipse.mylyn.internal.tasks.ui.actions.CopyTaskDetailsAction;
-import org.eclipse.mylyn.internal.tasks.ui.actions.OpenTaskListElementAction;
-import org.eclipse.mylyn.internal.tasks.ui.actions.OpenWithBrowserAction;
-import org.eclipse.mylyn.internal.tasks.ui.actions.TaskActivateAction;
-import org.eclipse.mylyn.internal.tasks.ui.actions.TaskDeactivateAction;
-import org.eclipse.mylyn.internal.tasks.ui.views.TaskListView;
-import org.eclipse.mylyn.tasks.core.AbstractTask;
-import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
-import org.eclipse.mylyn.tasks.core.ITaskActivityListener;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
-import org.eclipse.swt.events.MouseAdapter;
-import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.GC;
-import org.eclipse.swt.graphics.Point;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Control;
-import org.eclipse.swt.widgets.Menu;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.forms.events.HyperlinkAdapter;
-import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.internal.ObjectActionContributorManager;
-import org.eclipse.ui.internal.WorkbenchWindow;
-import org.eclipse.ui.internal.layout.IWindowTrim;
-import org.eclipse.ui.menus.WorkbenchWindowControlContribution;
-
-/**
- * @author Mik Kersten
- * @author Leo Dos Santos
- */
-public class TaskTrimWidget extends WorkbenchWindowControlContribution {
-
- public static String ID_CONTAINER = "org.eclipse.mylyn.tasks.ui.trim.container";
-
- public static String ID_CONTROL = "org.eclipse.mylyn.tasks.ui.trim.control";
-
- private Composite composite = null;
-
- private AbstractTask activeTask = null;
-
- private MenuManager menuManager = null;
-
- private Menu menu = null;
-
- private TaskListHyperlink activeTaskLabel;
-
- private OpenWithBrowserAction openWithBrowserAction = new OpenWithBrowserAction();
-
- private CopyTaskDetailsAction copyTaskDetailsAction = new CopyTaskDetailsAction(false);
-
- private Point p;
-
- private final ITaskActivityListener TASK_CHANGE_LISTENER = new ITaskActivityListener() {
-
- public void taskActivated(AbstractTask task) {
- activeTask = task;
- indicateActiveTask();
- }
-
- public void taskDeactivated(AbstractTask task) {
- activeTask = null;
- indicateNoActiveTask();
- }
-
- public void activityChanged(ScheduledTaskContainer week) {
- }
-
- public void taskListRead() {
- }
- };
-
- private IPropertyChangeListener SHOW_TRIM_LISTENER = new IPropertyChangeListener() {
- public void propertyChange(PropertyChangeEvent event) {
- String property = event.getProperty();
- if(property.equals(TasksUiPreferenceConstants.SHOW_TRIM)) {
- setTrimVisible((Boolean) event.getNewValue());
- }
- }
- };
-
- public TaskTrimWidget() {
- TasksUiPlugin.getTaskListManager().addActivityListener(TASK_CHANGE_LISTENER);
- TasksUiPlugin.getDefault().getPreferenceStore().addPropertyChangeListener(SHOW_TRIM_LISTENER);
- hookContextMenu();
- }
-
- private void setTrimVisible(boolean visible) {
- IWorkbenchWindow window = TasksUiPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow();
- IWindowTrim trim = ((WorkbenchWindow) window).getTrimManager().getTrim(
- "org.eclipse.mylyn.tasks.ui.trim.container");
- if (trim != null) {
- ((WorkbenchWindow) window).getTrimManager().setTrimVisible(trim, visible);
- }
- }
-
- @Override
- public void dispose() {
- if (composite != null && !composite.isDisposed()) {
- composite.dispose();
- }
- composite = null;
-
- if (menuManager != null) {
- menuManager.removeAll();
- menuManager.dispose();
- }
- menuManager = null;
-
- if (menu != null && !menu.isDisposed()) {
- menu.dispose();
- }
- menu = null;
-
- TasksUiPlugin.getTaskListManager().removeActivityListener(TASK_CHANGE_LISTENER);
- TasksUiPlugin.getDefault().getPreferenceStore().removePropertyChangeListener(SHOW_TRIM_LISTENER);
- }
-
- @Override
- protected Control createControl(Composite parent) {
- composite = new Composite(parent, SWT.NONE);
-
- GridLayout layout = new GridLayout();
- layout.numColumns = 1;
- layout.horizontalSpacing = 0;
- layout.marginHeight = 0;
- layout.marginLeft = 0;
- layout.marginRight = 0;
- composite.setLayout(layout);
-
- composite.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, false, true));
-
- createStatusComposite(composite);
-
- return composite;
- }
-
- private Composite createStatusComposite(final Composite container) {
- GC gc = new GC(container);
- p = gc.textExtent("WWWWWWWWWWWWWWW");
- gc.dispose();
-
- activeTaskLabel = new TaskListHyperlink(container, SWT.RIGHT);
- // activeTaskLabel.setLayoutData(new GridData(p.x, SWT.DEFAULT));
- GridData gridData = new GridData(SWT.LEFT, SWT.CENTER, false, true);
- gridData.widthHint = p.x;
- gridData.minimumWidth = p.x;
- gridData.horizontalIndent = 0;
- activeTaskLabel.setLayoutData(gridData);
- activeTaskLabel.setText("<no task active>");
-
- activeTask = TasksUiPlugin.getTaskListManager().getTaskList().getActiveTask();
- if (activeTask != null) {
- indicateActiveTask();
- }
-
- activeTaskLabel.addMenuDetectListener(new MenuDetectListener() {
- public void menuDetected(MenuDetectEvent e) {
- if (menu != null) {
- menu.dispose();
- }
- menu = menuManager.createContextMenu(container);
- menu.setVisible(true);
- }
- });
-
- activeTaskLabel.addHyperlinkListener(new HyperlinkAdapter() {
- @Override
- public void linkActivated(HyperlinkEvent e) {
- if (TaskListView.getFromActivePerspective().getDrilledIntoCategory() != null) {
- TaskListView.getFromActivePerspective().goUpToRoot();
- }
- TasksUiUtil.refreshAndOpenTaskListElement((TasksUiPlugin.getTaskListManager().getTaskList().getActiveTask()));
- }
- });
-
- activeTaskLabel.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseDown(MouseEvent e) {
- // if (TaskListFilteredTree.super.filterText.getText().length()
- // > 0) {
- // TaskListFilteredTree.super.filterText.setText("");
- // TaskListFilteredTree.this.textChanged();
- // }
- if (TaskListView.getFromActivePerspective().getDrilledIntoCategory() != null) {
- TaskListView.getFromActivePerspective().goUpToRoot();
- }
- TasksUiUtil.refreshAndOpenTaskListElement((TasksUiPlugin.getTaskListManager().getTaskList()
- .getActiveTask()));
- }
- });
-
- return activeTaskLabel;
- }
-
- private void hookContextMenu() {
- menuManager = new MenuManager("#PopupMenu");
- menuManager.setRemoveAllWhenShown(true);
- menuManager.addMenuListener(new IMenuListener() {
- public void menuAboutToShow(IMenuManager manager) {
- fillContextMenu(manager);
- }
- });
- }
-
- // Inspired by TaskListView, TaskEditorActionContributor.
- private void fillContextMenu(IMenuManager manager) {
- if (activeTask != null) {
- IStructuredSelection selection = new StructuredSelection(activeTask);
- openWithBrowserAction.selectionChanged(selection);
- copyTaskDetailsAction.selectionChanged(selection);
-
- manager.add(new OpenTaskListElementAction(null) {
- @Override
- public void run() {
- TasksUiUtil.refreshAndOpenTaskListElement(activeTask);
- }
- });
-
- manager.add(openWithBrowserAction);
- if (activeTask.hasValidUrl()) {
- openWithBrowserAction.setEnabled(true);
- } else {
- openWithBrowserAction.setEnabled(false);
- }
-
- if (activeTask.isActive()) {
- manager.add(new TaskDeactivateAction() {
- @Override
- public void run() {
- super.run(activeTask);
- }
- });
- } else {
- manager.add(new TaskActivateAction() {
- @Override
- public void run() {
- TasksUiPlugin.getTaskListManager().getTaskActivationHistory().addTask(activeTask);
- super.run(activeTask);
- }
- });
- }
-
- manager.add(new Separator());
-
- for (String menuPath : TasksUiPlugin.getDefault().getDynamicMenuMap().keySet()) {
- for (IDynamicSubMenuContributor contributor : TasksUiPlugin.getDefault().getDynamicMenuMap().get(
- menuPath)) {
- List<AbstractTaskContainer> selectedElements = new ArrayList<AbstractTaskContainer>();
- selectedElements.add(activeTask);
- MenuManager subMenuManager = contributor.getSubMenuManager(selectedElements);
- if (subMenuManager != null) {
- manager.add(subMenuManager);
- }
- }
- }
-
- manager.add(new Separator());
- manager.add(copyTaskDetailsAction);
- manager.add(new Separator());
-
- ObjectActionContributorManager.getManager().contributeObjectActions(null, manager,
- new ISelectionProvider() {
-
- public void addSelectionChangedListener(ISelectionChangedListener listener) {
- // ignore
- }
-
- public ISelection getSelection() {
- return new StructuredSelection(activeTask);
- }
-
- public void removeSelectionChangedListener(ISelectionChangedListener listener) {
- // ignore
- }
-
- public void setSelection(ISelection selection) {
- // ignore
- }
- });
- }
- }
-
- public void indicateActiveTask() {
- if (activeTaskLabel != null && activeTaskLabel.isDisposed()) {
- return;
- }
-
- //activeTaskLabel.setText(shortenText(activeTask.getSummary()));
- activeTaskLabel.setText(activeTask.getSummary());
- activeTaskLabel.setUnderlined(true);
- activeTaskLabel.setToolTipText(activeTask.getSummary());
- }
-
- public void indicateNoActiveTask() {
- if (activeTaskLabel != null && activeTaskLabel.isDisposed()) {
- return;
- }
-
- activeTaskLabel.setText("<no active task>");
- activeTaskLabel.setUnderlined(false);
- activeTaskLabel.setToolTipText("");
- }
-
-// // From PerspectiveBarContributionItem
-// private String shortenText(String taskLabel) {
-// if (taskLabel == null || composite == null || composite.isDisposed()) {
-// return null;
-// }
-//
-// String returnText = taskLabel;
-// GC gc = new GC(composite);
-// int maxWidth = p.x;
-//
-// if (gc.textExtent(taskLabel).x > maxWidth) {
-// for (int i = taskLabel.length(); i > 0; i--) {
-// String test = taskLabel.substring(0, i);
-// test = test + "...";
-// if (gc.textExtent(test).x < maxWidth) {
-// returnText = test;
-// break;
-// }
-// }
-// }
-//
-// gc.dispose();
-// return returnText;
-// }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java
index f4ab72aef..b23c90392 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/TaskWorkingSetAction.java
@@ -330,7 +330,7 @@ public class TaskWorkingSetAction extends Action implements IMenuCreator {
@Override
protected void availableWorkingSetsChanged() {
viewer.setInput(window.getWorkbench().getWorkingSetManager().getWorkingSets());
- super.availableWorkingSetsChanged();
+// super.availableWorkingSetsChanged();
}
/**
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ToggleWorkingSetAction.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ToggleWorkingSetAction.java
index a826d020a..6dde9a9bf 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ToggleWorkingSetAction.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/actions/ToggleWorkingSetAction.java
@@ -34,7 +34,7 @@ public class ToggleWorkingSetAction extends Action {
public ToggleWorkingSetAction(IWorkingSet set) {
super(set.getLabel(), IAction.AS_CHECK_BOX);
- setImageDescriptor(set.getImageDescriptor());
+// setImageDescriptor(set.getImageDescriptor());
this.workingSet = set;
setChecked(TaskWorkingSetUpdater.isWorkingSetEnabled(set));
}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java
deleted file mode 100644
index c38af0ff7..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskHyperlinkDetector.java
+++ /dev/null
@@ -1,115 +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.tasks.ui.editors;
-
-import org.eclipse.core.resources.IResource;
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-import org.eclipse.mylyn.tasks.core.AbstractRepositoryConnector;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.eclipse.mylyn.tasks.core.TaskRepositoryManager;
-import org.eclipse.mylyn.tasks.ui.AbstractRepositoryConnectorUi;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
-import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.PlatformUI;
-
-/**
- * @author Rob Elves
- * @author Steffen Pingel
- * @author Eugene Kuleshov
- */
-public class TaskHyperlinkDetector extends AbstractHyperlinkDetector {
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- if (region == null || textViewer == null) {
- return null;
- }
-
- IDocument document = textViewer.getDocument();
- if (document == null) {
- return null;
- }
-
- IRegion lineInfo;
- String line;
- try {
- lineInfo = document.getLineInformationOfOffset(region.getOffset());
- line = document.get(lineInfo.getOffset(), lineInfo.getLength());
- } catch (BadLocationException ex) {
- return null;
- }
-
- TaskRepository repository = getRepository(textViewer);
- if (repository == null) {
- repository = guessRepository(line);
- }
- if (repository == null) {
- return null;
- }
-
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repository.getConnectorKind());
- if (connectorUi == null) {
- return null;
- }
-
- return connectorUi.findHyperlinks(repository, line, //
- region.getOffset() - lineInfo.getOffset(), lineInfo.getOffset());
- }
-
- private TaskRepository getRepository(ITextViewer textViewer) {
- TaskRepository repository = (TaskRepository) getAdapter(TaskRepository.class);
- if (repository != null) {
- return repository;
- }
-
- IResource resource = (IResource) getAdapter(IResource.class);
- if (resource == null) {
- if (textViewer instanceof RepositoryTextViewer) {
- RepositoryTextViewer viewer = (RepositoryTextViewer) textViewer;
- return viewer.getRepository();
- }
-
- // use currently active editor (if any)
- IWorkbenchPage activePage = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
- IWorkbenchPart part = activePage.getActivePart();
- if (part != null && part instanceof IEditorPart) {
- IEditorInput input = ((IEditorPart) part).getEditorInput();
- if (input != null) {
- resource = (IResource) input.getAdapter(IResource.class);
- }
- }
- }
- if (resource != null) {
- return TasksUiPlugin.getDefault().getRepositoryForResource(resource, true);
- }
- return null;
- }
-
- // TODO: extract similar code to OpenCorrespondingTaskAction#reconsile(ILinkedTaskInfo info)
- private TaskRepository guessRepository(String text) {
- TaskRepositoryManager manager = TasksUiPlugin.getRepositoryManager();
- for (AbstractRepositoryConnector c : manager.getRepositoryConnectors()) {
- for (TaskRepository repository : manager.getRepositories(c.getConnectorKind())) {
- String[] ids = c.getTaskIdsFromComment(repository, text);
- if (ids != null && ids.length > 0 && ids[0].length() > 0) {
- return repository;
- }
- }
- }
- return null;
- }
-
-}
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 713368cda..ad649d3eb 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
@@ -59,7 +59,7 @@ import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Spinner;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.PlatformUI;
-import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.events.ExpansionEvent;
@@ -305,7 +305,7 @@ public class TaskPlanningEditor extends TaskFormPage {
private void addHeaderControls() {
- if (parentEditor.getTopForm() != null) {
+ if (form.getForm() != null) {
activateAction = new Action() {
@Override
@@ -324,9 +324,9 @@ public class TaskPlanningEditor extends TaskFormPage {
activateAction.setImageDescriptor(TasksUiImages.TASK_ACTIVE_CENTERED);
activateAction.setToolTipText("Toggle Activation");
activateAction.setChecked(task.isActive());
- parentEditor.getTopForm().getToolBarManager().add(activateAction);
+ form.getForm().getToolBarManager().add(activateAction);
- parentEditor.getTopForm().getToolBarManager().update(true);
+ form.getForm().getToolBarManager().update(true);
}
// if (form.getToolBarManager() != null) {
@@ -365,7 +365,7 @@ public class TaskPlanningEditor extends TaskFormPage {
layout.marginHeight = 3;
nameValueComp.setLayout(layout);
toolkit.createLabel(nameValueComp, label, SWT.NONE).setForeground(
- toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.getColors().getColor(FormColors.TITLE));
Text text;
if ((SWT.READ_ONLY & style) == SWT.READ_ONLY) {
text = new Text(nameValueComp, style);
@@ -415,7 +415,7 @@ public class TaskPlanningEditor extends TaskFormPage {
GridLayout nameValueLayout = new GridLayout(2, false);
nameValueLayout.marginHeight = 3;
nameValueComp.setLayout(nameValueLayout);
- toolkit.createLabel(nameValueComp, "Priority:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(nameValueComp, "Priority:").setForeground(toolkit.getColors().getColor(FormColors.TITLE));
priorityCombo = new CCombo(nameValueComp, SWT.FLAT);
priorityCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
toolkit.paintBordersFor(nameValueComp);
@@ -446,7 +446,7 @@ public class TaskPlanningEditor extends TaskFormPage {
nameValueComp = toolkit.createComposite(statusComposite);
nameValueComp.setLayout(new GridLayout(2, false));
- toolkit.createLabel(nameValueComp, "Status:").setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ toolkit.createLabel(nameValueComp, "Status:").setForeground(toolkit.getColors().getColor(FormColors.TITLE));
statusCombo = new CCombo(nameValueComp, SWT.FLAT);
statusCombo.setData(FormToolkit.KEY_DRAW_BORDER, FormToolkit.TEXT_BORDER);
toolkit.paintBordersFor(nameValueComp);
@@ -497,7 +497,7 @@ public class TaskPlanningEditor extends TaskFormPage {
GridDataFactory.fillDefaults().grab(true, false).applyTo(urlComposite);
Label label = toolkit.createLabel(urlComposite, "URL:");
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
issueReportURL = toolkit.createText(urlComposite, task.getUrl(), SWT.FLAT);
issueReportURL.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
@@ -632,7 +632,7 @@ public class TaskPlanningEditor extends TaskFormPage {
Composite nameValueComp = makeComposite(sectionClient, 3);
Label label = toolkit.createLabel(nameValueComp, LABEL_SCHEDULE);
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
datePicker = new DatePicker(nameValueComp, SWT.FLAT, DatePicker.LABEL_CHOOSE);
@@ -673,7 +673,7 @@ public class TaskPlanningEditor extends TaskFormPage {
nameValueComp = makeComposite(sectionClient, 3);
label = toolkit.createLabel(nameValueComp, LABEL_DUE);
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
dueDatePicker = new DatePicker(nameValueComp, SWT.FLAT, DatePicker.LABEL_CHOOSE);
@@ -719,7 +719,7 @@ public class TaskPlanningEditor extends TaskFormPage {
// Estimated time
nameValueComp = makeComposite(sectionClient, 2);
label = toolkit.createLabel(nameValueComp, "Estimated hours:");
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
estimated = new Spinner(nameValueComp, SWT.NONE);
toolkit.adapt(estimated, true, true);
@@ -745,7 +745,7 @@ public class TaskPlanningEditor extends TaskFormPage {
// GridDataFactory.fillDefaults().span(2, 1).align(SWT.LEFT,
// SWT.DEFAULT).applyTo(nameValueComp);
label = toolkit.createLabel(nameValueComp, "Active:");
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
label.setToolTipText(DESCRIPTION_ESTIMATED);
String elapsedTimeString = NO_TIME_ELAPSED;
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java
deleted file mode 100644
index 5ad46f7f6..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/editors/TaskUrlHyperlinkDetector.java
+++ /dev/null
@@ -1,114 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 Mylar 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.tasks.ui.editors;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.StringTokenizer;
-
-import org.eclipse.jface.text.BadLocationException;
-import org.eclipse.jface.text.IDocument;
-import org.eclipse.jface.text.IRegion;
-import org.eclipse.jface.text.ITextViewer;
-import org.eclipse.jface.text.Region;
-import org.eclipse.jface.text.hyperlink.AbstractHyperlinkDetector;
-import org.eclipse.jface.text.hyperlink.IHyperlink;
-
-/**
- * Source from {@link org.eclipse.jface.text.hyperlink.URLHyperlinkDetector}
- *
- * @author Rob Elves
- */
-public class TaskUrlHyperlinkDetector extends AbstractHyperlinkDetector {
-
- public IHyperlink[] detectHyperlinks(ITextViewer textViewer, IRegion region, boolean canShowMultipleHyperlinks) {
- if (region == null || textViewer == null)
- return null;
-
- IDocument document = textViewer.getDocument();
-
- int offset = region.getOffset();
-
- String urlString = null;
- if (document == null)
- return null;
-
- IRegion lineInfo;
- String line;
- try {
- lineInfo = document.getLineInformationOfOffset(offset);
- line = document.get(lineInfo.getOffset(), lineInfo.getLength());
- } catch (BadLocationException ex) {
- return null;
- }
-
- int offsetInLine = offset - lineInfo.getOffset();
-
- boolean startDoubleQuote = false;
- int urlOffsetInLine = 0;
- int urlLength = 0;
-
- int urlSeparatorOffset = line.indexOf("://"); //$NON-NLS-1$
- while (urlSeparatorOffset >= 0) {
-
- // URL protocol (left to "://")
- urlOffsetInLine = urlSeparatorOffset;
- char ch;
- do {
- urlOffsetInLine--;
- ch = ' ';
- if (urlOffsetInLine > -1)
- ch = line.charAt(urlOffsetInLine);
- startDoubleQuote = ch == '"';
- } while (Character.isUnicodeIdentifierStart(ch));
- urlOffsetInLine++;
-
- // Right to "://"
- StringTokenizer tokenizer = new StringTokenizer(line.substring(urlSeparatorOffset + 3),
- " \t\n\r\f<>", false); //$NON-NLS-1$
- if (!tokenizer.hasMoreTokens())
- return null;
-
- urlLength = tokenizer.nextToken().length() + 3 + urlSeparatorOffset - urlOffsetInLine;
- if (offsetInLine >= urlOffsetInLine && offsetInLine <= urlOffsetInLine + urlLength)
- break;
-
- urlSeparatorOffset = line.indexOf("://", urlSeparatorOffset + 1); //$NON-NLS-1$
- }
-
- if (urlSeparatorOffset < 0)
- return null;
-
- if (startDoubleQuote) {
- int endOffset = -1;
- int nextDoubleQuote = line.indexOf('"', urlOffsetInLine);
- int nextWhitespace = line.indexOf(' ', urlOffsetInLine);
- if (nextDoubleQuote != -1 && nextWhitespace != -1)
- endOffset = Math.min(nextDoubleQuote, nextWhitespace);
- else if (nextDoubleQuote != -1)
- endOffset = nextDoubleQuote;
- else if (nextWhitespace != -1)
- endOffset = nextWhitespace;
- if (endOffset != -1)
- urlLength = endOffset - urlOffsetInLine;
- }
-
- // Set and validate URL string
- try {
- urlString = line.substring(urlOffsetInLine, urlOffsetInLine + urlLength);
- new URL(urlString);
- } catch (MalformedURLException ex) {
- urlString = null;
- return null;
- }
-
- IRegion urlRegion = new Region(lineInfo.getOffset() + urlOffsetInLine, urlLength);
- return new IHyperlink[] { new TaskUrlHyperlink(urlRegion, urlString) };
- }
-}
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/DatePickerPanel.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/DatePickerPanel.java
index b18155671..29494da13 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/DatePickerPanel.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/DatePickerPanel.java
@@ -1,36 +1,43 @@
/*******************************************************************************
- * Copyright (c) 2004, 2007 Mylyn project committers and others.
+ * Copyright (c) 2004 - 2006 University Of British Columbia 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
+ *
+ * Contributors:
+ * University Of British Columbia - initial API and implementation
*******************************************************************************/
package org.eclipse.mylyn.internal.tasks.ui.views;
import java.text.DateFormat;
+import java.text.DateFormatSymbols;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.util.List;
import org.eclipse.jface.layout.GridDataFactory;
-import org.eclipse.jface.viewers.ArrayContentProvider;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
-import org.eclipse.jface.viewers.ListViewer;
import org.eclipse.jface.viewers.SelectionChangedEvent;
-import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.swt.SWT;
import org.eclipse.swt.events.KeyEvent;
import org.eclipse.swt.events.KeyListener;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.SelectionAdapter;
import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.DateTime;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
/**
* @author Bahadir Yagan
@@ -39,46 +46,64 @@ import org.eclipse.swt.widgets.DateTime;
*/
public class DatePickerPanel extends Composite implements KeyListener, ISelectionProvider {
+ // private Combo timeCombo = null;
+
+ // private Combo monthCombo = null;
+
private org.eclipse.swt.widgets.List timeList = null;
- private ISelection selection = null;
+ private org.eclipse.swt.widgets.List monthList = null;
+
+ private Spinner yearSpinner = null;
+
+ private Composite headerComposite = null;
+
+ private Composite calendarComposite = null;
+
+ private Calendar initialDate = null;
private Calendar date = null;
- private DateTime calendar = null;
+ private ISelection selection = null;
+
+ private DateFormatSymbols dateFormatSymbols = null;
+
+ private Label[] calendarLabels = null;
private List<ISelectionChangedListener> selectionListeners = new ArrayList<ISelectionChangedListener>();
public DatePickerPanel(Composite parent, int style, Calendar initialDate) {
super(parent, style);
+ this.initialDate = GregorianCalendar.getInstance();
+ this.initialDate.setTime(initialDate.getTime());
this.date = initialDate;
initialize();
- setDate(date);
- //this.setBackground()
+ updateCalendar();
}
private void initialize() {
if (date == null) {
date = GregorianCalendar.getInstance();
- date.set(Calendar.HOUR_OF_DAY, TasksUiPlugin.getTaskListManager().getStartHour());
}
+ dateFormatSymbols = new DateFormatSymbols();
+ calendarLabels = new Label[42];
GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 2;
+ gridLayout.numColumns = 3;
+ // gridLayout.horizontalSpacing = 3;
+ // gridLayout.verticalSpacing = 3;
this.setLayout(gridLayout);
- calendar = new DateTime(this, SWT.CALENDAR);
- calendar.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- date.set(Calendar.YEAR, calendar.getYear());
- date.set(Calendar.MONTH, calendar.getMonth());
- date.set(Calendar.DAY_OF_MONTH, calendar.getDay());
- setSelection(new DateSelection(date));
- notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
- }
- });
-
+ // pickerPanel.setSize(new org.eclipse.swt.graphics.Point(400, 200));
+ createMonthList(this);
+ Composite middle = new Composite(this, SWT.NONE);
+ GridLayout middleLayout = new GridLayout();
+ middleLayout.verticalSpacing = 0;
+ middle.setLayout(middleLayout);
+ createYearSpinner(middle);
+ createComposite(middle);
+ createComposite1(middle);
+ createCalendarData();
createTimeList(this);
+
}
/**
@@ -86,49 +111,248 @@ public class DatePickerPanel extends Composite implements KeyListener, ISelectio
*
*/
private void createTimeList(Composite composite) {
-
+ timeList = new org.eclipse.swt.widgets.List(composite, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
DateFormat dateFormat = DateFormat.getTimeInstance(DateFormat.SHORT);
- Calendar tempCalendar = Calendar.getInstance();
+ Calendar tempCalendar = Calendar.getInstance();
tempCalendar.set(Calendar.MINUTE, 0);
tempCalendar.set(Calendar.SECOND, 0);
- String[] times = new String[24];
- for (int x = 0; x < 24; x++) {
+ for(int x = 0; x < 24; x++) {
tempCalendar.set(Calendar.HOUR_OF_DAY, x);
- String timeString = dateFormat.format(tempCalendar.getTime());
- times[x] = timeString;
+ timeList.add(dateFormat.format(tempCalendar.getTime()));
}
- ListViewer listViewer = new ListViewer(composite);
+ if (date == null) {
+ timeList.select(Calendar.getInstance().get(Calendar.HOUR_OF_DAY));
+ } else {
+ timeList.select(date.get(Calendar.HOUR_OF_DAY));
+ }
+ timeList.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ date.set(Calendar.HOUR_OF_DAY, timeList.getSelectionIndex());
+ date.set(Calendar.MINUTE, 0);
+ setSelection(new DateSelection(date));
+ notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
+ // updateCalendar();
+ }
+ });
+ GridDataFactory.fillDefaults().hint(SWT.DEFAULT, 150).grab(false, true).applyTo(timeList);
+ timeList.addKeyListener(this);
+ }
- listViewer.setContentProvider(new ArrayContentProvider());
- listViewer.setInput(times);
+ // /**
+ // * This method initializes the month combo
+ // *
+ // */
+ // private void createTimeCombo(Composite composite) {
+ // timeCombo = new Combo(composite, SWT.READ_ONLY);
+ // timeCombo.setItems(new String[] { "12:00 AM", "1:00 AM", "2:00 AM", "3:00
+ // AM", "4:00 AM", "5:00 AM",
+ // "6:00 AM", "7:00 AM", "8:00 AM", "9:00 AM", "10:00 AM", "11:00 AM",
+ // "12:00 PM", "1:00 PM",
+ // "2:00 PM", "3:00 PM", "4:00 PM", "5:00 PM", "6:00 PM", "7:00 PM", "8:00
+ // PM", "9:00 PM", "10:00 PM",
+ // "11:00 PM" });
+ // if(date == null) {
+ // timeCombo.select(Calendar.getInstance().get(Calendar.HOUR_OF_DAY));
+ // } else {
+ // timeCombo.select(date.get(Calendar.HOUR_OF_DAY));
+ // }
+ // timeCombo.addModifyListener(new ModifyListener() {
+ // public void modifyText(ModifyEvent arg0) {
+ // date.set(Calendar.HOUR_OF_DAY, timeCombo.getSelectionIndex());
+ // date.set(Calendar.MINUTE, 0);
+ // setSelection(new DateSelection(date));
+ // notifyListeners(new SelectionChangedEvent(DatePickerPanel.this,
+ // getSelection()));
+ // //updateCalendar();
+ // }
+ // });
+ // timeCombo.addKeyListener(this);
+ // }
- timeList = listViewer.getList();
+ /**
+ * This method initializes the month combo
+ *
+ */
+ private void createMonthList(Composite composite) {
+ monthList = new org.eclipse.swt.widgets.List(composite, SWT.READ_ONLY | SWT.SINGLE | SWT.BORDER | SWT.V_SCROLL);
+ for (String month : dateFormatSymbols.getMonths()) {
+ if (month != null && !month.equals("")) {
+ monthList.add(month);
+ }
+ }
+ GridDataFactory.fillDefaults().hint(SWT.DEFAULT, 50).grab(false, false).applyTo(monthList);
+ monthList.select(date.get(Calendar.MONTH));
+ monthList.addSelectionListener(new SelectionAdapter() {
- listViewer.addSelectionChangedListener(new ISelectionChangedListener() {
+ @Override
+ public void widgetSelected(SelectionEvent e) {
+ date.set(Calendar.MONTH, monthList.getSelectionIndex());
+ setSelection(new DateSelection(date));
+ notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
+ updateCalendar();
+ }
+ });
+ monthList.addKeyListener(this);
+ }
- public void selectionChanged(SelectionChangedEvent event) {
- date.set(Calendar.HOUR_OF_DAY, timeList.getSelectionIndex());
- date.set(Calendar.MINUTE, 0);
+ private void createYearSpinner(Composite composite) {
+ Composite yearComposite = new Composite(composite, SWT.NONE);
+ GridDataFactory.fillDefaults().align(SWT.CENTER, SWT.CENTER).applyTo(yearComposite);
+ yearComposite.setLayout(new GridLayout(2, false));
+ org.eclipse.swt.widgets.Label yearLabel = new org.eclipse.swt.widgets.Label(yearComposite, SWT.NONE);
+ yearLabel.setText("Year: ");
+ GridData gridData1 = new GridData();
+ gridData1.horizontalAlignment = GridData.BEGINNING;
+ gridData1.grabExcessVerticalSpace = false;
+ gridData1.grabExcessHorizontalSpace = false;
+ gridData1.heightHint = -1;
+ gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
+ yearSpinner = new Spinner(yearComposite, SWT.BORDER | SWT.READ_ONLY);
+ yearSpinner.setMinimum(1900);
+ yearSpinner.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ yearSpinner.setDigits(0);
+ yearSpinner.setMaximum(3000);
+ yearSpinner.setLayoutData(gridData1);
+ yearSpinner.setSelection(date.get(Calendar.YEAR));
+ yearSpinner.addModifyListener(new ModifyListener() {
+
+ public void modifyText(ModifyEvent arg0) {
+ date.set(Calendar.YEAR, yearSpinner.getSelection());
setSelection(new DateSelection(date));
notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
+ updateCalendar();
}
+
});
+ yearSpinner.addKeyListener(this);
+ }
- GridDataFactory.fillDefaults().hint(SWT.DEFAULT, 150).grab(false, true).applyTo(timeList);
- if (date != null) {
- listViewer.setSelection(new StructuredSelection(times[date.get(Calendar.HOUR_OF_DAY)]), true);
- } else {
- listViewer.setSelection(new StructuredSelection(times[8]), true);
+ private void createComposite(Composite composite) {
+ String[] weekDays = dateFormatSymbols.getWeekdays();
+ GridLayout gridLayout1 = new GridLayout();
+ gridLayout1.numColumns = 7;
+ gridLayout1.verticalSpacing = 0;
+ gridLayout1.makeColumnsEqualWidth = true;
+ GridData gridData = new org.eclipse.swt.layout.GridData();
+ gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.grabExcessVerticalSpace = false;
+ // gridData.horizontalSpan = 3;
+ gridData.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
+ headerComposite = new Composite(composite, SWT.NONE);
+ headerComposite.setLayoutData(gridData);
+ headerComposite.setLayout(gridLayout1);
+ GridData labelGridData = new org.eclipse.swt.layout.GridData();
+ labelGridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
+ labelGridData.grabExcessHorizontalSpace = true;
+ labelGridData.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
+ for (int i = 1; i < 8; ++i) {
+ Label headerLabel = new Label(headerComposite, SWT.BEGINNING);
+ headerLabel.setText(weekDays[i].substring(0, 3));
+ headerLabel.setLayoutData(labelGridData);
+ }
+ }
+
+ /**
+ * This method initializes composite1
+ *
+ */
+ private void createComposite1(Composite composite) {
+ GridLayout gridLayout2 = new GridLayout();
+ gridLayout2.numColumns = 7;
+ gridLayout2.verticalSpacing = 0;
+ gridLayout2.makeColumnsEqualWidth = true;
+ GridData gridData1 = new org.eclipse.swt.layout.GridData();
+ // gridData1.horizontalSpan = 3;
+ gridData1.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
+ gridData1.verticalAlignment = org.eclipse.swt.layout.GridData.BEGINNING;
+ gridData1.grabExcessVerticalSpace = false;
+ gridData1.grabExcessHorizontalSpace = true;
+ calendarComposite = new Composite(composite, SWT.BORDER);
+ calendarComposite.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ calendarComposite.setLayout(gridLayout2);
+ calendarComposite.setLayoutData(gridData1);
+ }
+
+ private void createCalendarData() {
+ GridData gridData = new org.eclipse.swt.layout.GridData();
+ gridData.horizontalAlignment = org.eclipse.swt.layout.GridData.FILL;
+ gridData.grabExcessHorizontalSpace = true;
+ gridData.verticalAlignment = org.eclipse.swt.layout.GridData.CENTER;
+ for (int i = 0; i < 42; ++i) {
+ Label headerLabel = new Label(calendarComposite, SWT.CENTER);
+ headerLabel.setText("99");
+ headerLabel.setLayoutData(gridData);
+ calendarLabels[i] = headerLabel;
+ headerLabel.addMouseListener(new MouseListener() {
+
+ public void mouseDoubleClick(MouseEvent arg0) {
+ // TODO Auto-generated method stub
+
+ }
+
+ public void mouseDown(MouseEvent arg0) {
+ unSellectAll();
+ Label label = (Label) arg0.getSource();
+ if (!label.getText().equals("")) {
+ label.setBackground(Display.getDefault().getSystemColor(SWT.COLOR_LIST_SELECTION));
+ label.setForeground(Display.getDefault().getSystemColor(SWT.COLOR_WHITE));
+ }
+ }
+
+ public void mouseUp(MouseEvent arg0) {
+ Label label = (Label) arg0.getSource();
+ if (!label.getText().equals("")) {
+ date.set(Calendar.YEAR, yearSpinner.getSelection());
+ date.set(Calendar.MONTH, monthList.getSelectionIndex());
+ date.set(Calendar.DAY_OF_MONTH, Integer.parseInt(label.getText()));
+ setSelection(new DateSelection(date));
+ notifyListeners(new SelectionChangedEvent(DatePickerPanel.this, getSelection()));
+ }
+
+ }
+
+ });
+ }
+ }
+
+ private void updateCalendar() {
+ unSellectAll();
+ // Fill Labels
+ Calendar cal = new GregorianCalendar(date.get(Calendar.YEAR), date.get(Calendar.MONTH), 1);
+ int dayofWeek = cal.get(Calendar.DAY_OF_WEEK) - 1;
+
+ for (int i = 0; i < dayofWeek; ++i) {
+ calendarLabels[i].setText("");
+ }
+
+ for (int i = 1; i <= cal.getActualMaximum(Calendar.DAY_OF_MONTH); ++i) {
+ calendarLabels[i + dayofWeek - 1].setText("" + i);
+ }
+
+ for (int i = cal.getActualMaximum(Calendar.DAY_OF_MONTH) + dayofWeek; i < 42; ++i) {
+ calendarLabels[i].setText("");
+ }
+
+ calendarLabels[date.get(Calendar.DAY_OF_MONTH) + dayofWeek - 1].setBackground(Display.getDefault()
+ .getSystemColor(SWT.COLOR_LIST_SELECTION));
+ calendarLabels[date.get(Calendar.DAY_OF_MONTH) + dayofWeek - 1].setForeground(Display.getDefault()
+ .getSystemColor(SWT.COLOR_WHITE));
+
+ }
+
+ private void unSellectAll() {
+ for (int i = 0; i < 42; ++i) {
+ calendarLabels[i].setForeground(Display.getDefault().getSystemColor(SWT.COLOR_BLACK));
+ calendarLabels[i].setBackground(Display.getCurrent().getSystemColor(SWT.COLOR_WHITE));
}
- timeList.addKeyListener(this);
}
public void setDate(Calendar date) {
this.date = date;
- calendar.setYear(date.get(Calendar.YEAR));
- calendar.setMonth(date.get(Calendar.MONTH));
- calendar.setDay(date.get(Calendar.DAY_OF_MONTH));
+ updateCalendar();
}
public void keyPressed(KeyEvent e) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
index d3566f49a..bafb09410 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListFilteredTree.java
@@ -15,13 +15,11 @@ import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
-import org.eclipse.jface.layout.TreeColumnLayout;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.ISelectionChangedListener;
import org.eclipse.jface.viewers.ISelectionProvider;
import org.eclipse.jface.viewers.IStructuredSelection;
import org.eclipse.jface.viewers.StructuredSelection;
-import org.eclipse.jface.viewers.TreeViewer;
import org.eclipse.mylyn.internal.tasks.core.ScheduledTaskContainer;
import org.eclipse.mylyn.internal.tasks.ui.IDynamicSubMenuContributor;
import org.eclipse.mylyn.internal.tasks.ui.TaskListColorsAndFonts;
@@ -42,10 +40,9 @@ import org.eclipse.mylyn.tasks.core.TaskContainerDelta;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.MenuDetectEvent;
-import org.eclipse.swt.events.MenuDetectListener;
import org.eclipse.swt.events.MouseAdapter;
import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
import org.eclipse.swt.events.MouseTrackListener;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
@@ -107,18 +104,18 @@ public class TaskListFilteredTree extends AbstractFilteredTree {
});
}
- @Override
- protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
- // Use a single Composite for the Tree to being able to use the
- // TreeColumnLayout. See Bug 177891 for more details.
- Composite container = new Composite(parent, SWT.None);
- GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
- gridData.verticalIndent = 0;
- gridData.horizontalIndent = 0;
- container.setLayoutData(gridData);
- container.setLayout(new TreeColumnLayout());
- return super.doCreateTreeViewer(container, style);
- }
+ // @Override
+ // protected TreeViewer doCreateTreeViewer(Composite parent, int style) {
+ // // Use a single Composite for the Tree to being able to use the
+ // // TreeColumnLayout. See Bug 177891 for more details.
+ // Composite container = new Composite(parent, SWT.None);
+ // GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
+ // gridData.verticalIndent = 0;
+ // gridData.horizontalIndent = 0;
+ // container.setLayoutData(gridData);
+ // container.setLayout(new TreeColumnLayout());
+ // return super.doCreateTreeViewer(container, style);
+ // }
@Override
protected Composite createProgressComposite(Composite container) {
@@ -295,16 +292,36 @@ public class TaskListFilteredTree extends AbstractFilteredTree {
}
});
- activeTaskLink.addMenuDetectListener(new MenuDetectListener() {
- public void menuDetected(MenuDetectEvent e) {
- if (activeTaskMenu != null) {
- activeTaskMenu.dispose();
+ activeTaskLink.addMouseListener(new MouseListener() {
+
+ public void mouseDoubleClick(MouseEvent e) {
+ // ignore
+
+ }
+
+ public void mouseDown(MouseEvent e) {
+ if (e.button == 2) {
+ if (activeTaskMenu != null) {
+ activeTaskMenu.dispose();
+ }
+ activeTaskMenu = activeTaskMenuManager.createContextMenu(container);
+ activeTaskMenu.setVisible(true);
}
- activeTaskMenu = activeTaskMenuManager.createContextMenu(container);
- activeTaskMenu.setVisible(true);
}
+
+ public void mouseUp(MouseEvent e) {
+ // ignore
+
+ }
+
});
+// activeTaskLink.addMenuDetectListener(new MenuDetectListener() {
+// public void menuDetected(MenuDetectEvent e) {
+//
+// }
+// });
+
activeTaskLink.addMouseListener(new MouseAdapter() {
@Override
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
index 18188c04f..7023c2d86 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/views/TaskListView.java
@@ -26,13 +26,10 @@ import org.eclipse.jface.action.IToolBarManager;
import org.eclipse.jface.action.MenuManager;
import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.InputDialog;
-import org.eclipse.jface.layout.TreeColumnLayout;
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.jface.util.IPropertyChangeListener;
import org.eclipse.jface.util.PropertyChangeEvent;
import org.eclipse.jface.viewers.CellEditor;
-import org.eclipse.jface.viewers.ColumnPixelData;
-import org.eclipse.jface.viewers.ColumnWeightData;
import org.eclipse.jface.viewers.DoubleClickEvent;
import org.eclipse.jface.viewers.IDoubleClickListener;
import org.eclipse.jface.viewers.IOpenListener;
@@ -921,18 +918,18 @@ public class TaskListView extends ViewPart implements IPropertyChangeListener {
}
private void configureColumns(final String[] columnNames, final int[] columnWidths) {
- TreeColumnLayout layout = (TreeColumnLayout) getViewer().getTree().getParent().getLayout();
+// TreeColumnLayout layout = (TreeColumnLayout) getViewer().getTree().getParent().getLayout();
getViewer().setColumnProperties(columnNames);
columns = new TreeColumn[columnNames.length];
for (int i = 0; i < columnNames.length; i++) {
columns[i] = new TreeColumn(getViewer().getTree(), 0);
columns[i].setText(columnNames[i]);
- if (i == 0) {
- layout.setColumnData(columns[i], new ColumnWeightData(100));
- } else {
- layout.setColumnData(columns[i], new ColumnPixelData(columnWidths[i]));
- }
+// if (i == 0) {
+// layout.setColumnData(columns[i], new ColumnWeightData(100));
+// } else {
+// layout.setColumnData(columns[i], new ColumnPixelData(columnWidths[i]));
+// }
// final int index = i;
columns[i].addSelectionListener(new SelectionAdapter() {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java
deleted file mode 100644
index a237e0dd4..000000000
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/internal/tasks/ui/workingsets/TaskWorkingSetElementAdapter.java
+++ /dev/null
@@ -1,51 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2004 - 2006 Mylar 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.tasks.ui.workingsets;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.mylyn.tasks.core.AbstractTaskContainer;
-import org.eclipse.ui.IWorkingSet;
-import org.eclipse.ui.IWorkingSetElementAdapter;
-
-/**
- * @author Eugene Kuleshov
- * @author Mik Kersten
- */
-public class TaskWorkingSetElementAdapter implements IWorkingSetElementAdapter {
-
- public IAdaptable[] adaptElements(IWorkingSet workingSet, IAdaptable[] elements) {
- for (int i = 0; i < elements.length; i++) {
- IAdaptable adaptable = elements[i];
- if (!(adaptable instanceof AbstractTaskContainer)) {
- return selectContainers(elements);
- }
- }
- return elements;
- }
-
- private IAdaptable[] selectContainers(IAdaptable[] elements) {
- List<IAdaptable> containers = new ArrayList<IAdaptable>(elements.length);
- for (IAdaptable adaptable : elements) {
- if (adaptable instanceof AbstractTaskContainer) {
- containers.add(adaptable);
- } else if (adaptable instanceof IProject) {
- containers.add(adaptable);
- }
- }
- return containers.toArray(new IAdaptable[containers.size()]);
- }
-
- public void dispose() {
- // ignore
- }
-} \ No newline at end of file
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 5c5fffa16..bb799b830 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
@@ -38,9 +38,6 @@ import org.eclipse.jface.action.Separator;
import org.eclipse.jface.dialogs.IMessageProvider;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.fieldassist.ContentProposalAdapter;
-import org.eclipse.jface.fieldassist.ControlDecoration;
-import org.eclipse.jface.fieldassist.FieldDecoration;
-import org.eclipse.jface.fieldassist.FieldDecorationRegistry;
import org.eclipse.jface.fieldassist.IContentProposalProvider;
import org.eclipse.jface.fieldassist.TextContentAdapter;
import org.eclipse.jface.layout.GridDataFactory;
@@ -99,7 +96,6 @@ import org.eclipse.mylyn.tasks.ui.AbstractDuplicateDetector;
import org.eclipse.mylyn.tasks.ui.TasksUiPlugin;
import org.eclipse.mylyn.tasks.ui.TasksUiUtil;
import org.eclipse.mylyn.tasks.ui.search.SearchHitCollector;
-import org.eclipse.osgi.util.NLS;
import org.eclipse.search.ui.NewSearchUI;
import org.eclipse.swt.SWT;
import org.eclipse.swt.custom.CCombo;
@@ -142,7 +138,7 @@ import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.fieldassist.ContentAssistCommandAdapter;
-import org.eclipse.ui.forms.IFormColors;
+import org.eclipse.ui.forms.FormColors;
import org.eclipse.ui.forms.IManagedForm;
import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.events.ExpansionAdapter;
@@ -156,7 +152,6 @@ import org.eclipse.ui.forms.widgets.ImageHyperlink;
import org.eclipse.ui.forms.widgets.ScrolledForm;
import org.eclipse.ui.forms.widgets.Section;
import org.eclipse.ui.internal.ObjectActionContributorManager;
-import org.eclipse.ui.keys.IBindingService;
import org.eclipse.ui.themes.IThemeManager;
import org.eclipse.ui.views.contentoutline.ContentOutline;
import org.eclipse.ui.views.contentoutline.IContentOutlinePage;
@@ -575,7 +570,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
Hyperlink link = new Hyperlink(composite, SWT.NONE);
link.setText(label);
link.setFont(TITLE_FONT);
- link.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ link.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
link.addHyperlinkListener(new HyperlinkAdapter() {
@Override
@@ -588,12 +583,12 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
}
};
- if (parentEditor.getTopForm() != null) {
- parentEditor.getTopForm().getToolBarManager().add(repositoryLabelControl);
+ if (form.getForm() != null) {
+ form.getForm().getToolBarManager().add(repositoryLabelControl);
if (repositoryTask != null) {
synchronizeEditorAction = new SynchronizeEditorAction();
synchronizeEditorAction.selectionChanged(new StructuredSelection(this));
- parentEditor.getTopForm().getToolBarManager().add(synchronizeEditorAction);
+ form.getForm().getToolBarManager().add(synchronizeEditorAction);
}
if (getHistoryUrl() != null) {
@@ -606,7 +601,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
historyAction.setImageDescriptor(TasksUiImages.TASK_REPOSITORY_HISTORY);
historyAction.setToolTipText(LABEL_HISTORY);
- parentEditor.getTopForm().getToolBarManager().add(historyAction);
+ form.getForm().getToolBarManager().add(historyAction);
}
if (repositoryTask != null) {
@@ -619,7 +614,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
openBrowserAction.setImageDescriptor(TasksUiImages.BROWSER_OPEN_TASK);
openBrowserAction.setToolTipText("Open with Web Browser");
- parentEditor.getTopForm().getToolBarManager().add(openBrowserAction);
+ form.getForm().getToolBarManager().add(openBrowserAction);
}
activateAction = new Action() {
@@ -641,14 +636,14 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
activateAction.setImageDescriptor(TasksUiImages.TASK_ACTIVE_CENTERED);
activateAction.setToolTipText("Toggle Activation");
activateAction.setChecked(repositoryTask.isActive());
- parentEditor.getTopForm().getToolBarManager().add(activateAction);
+ form.getForm().getToolBarManager().add(activateAction);
}
// Header drop down menu additions:
// form.getForm().getMenuManager().add(new
// SynchronizeSelectedAction());
- parentEditor.getTopForm().getToolBarManager().update(true);
+ form.getForm().getToolBarManager().update(true);
}
// if (form.getToolBarManager() != null) {
@@ -756,7 +751,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
Composite nameValue = toolkit.createComposite(headerInfoComposite);
nameValue.setLayout(new GridLayout(2, false));
Label label = toolkit.createLabel(nameValue, "ID:");// .setFont(TITLE_FONT);
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
// toolkit.createText(nameValue, idLabel, SWT.FLAT | SWT.READ_ONLY);
Text text = new Text(nameValue, SWT.FLAT | SWT.READ_ONLY);
toolkit.adapt(text, true, true);
@@ -860,7 +855,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
} else {
label = toolkit.createLabel(composite, attribute.getName());
}
- label.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ label.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.CENTER).applyTo(label);
return label;
}
@@ -1067,23 +1062,23 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
* @return the ContentAssistCommandAdapter for the field.
*/
protected ContentAssistCommandAdapter applyContentAssist(Text text, IContentProposalProvider proposalProvider) {
- ControlDecoration controlDecoration = new ControlDecoration(text, (SWT.TOP | SWT.LEFT));
- controlDecoration.setMarginWidth(0);
- controlDecoration.setShowHover(true);
- controlDecoration.setShowOnlyOnFocus(true);
-
- FieldDecoration contentProposalImage = FieldDecorationRegistry.getDefault().getFieldDecoration(
- FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
- controlDecoration.setImage(contentProposalImage.getImage());
+// ControlDecoration controlDecoration = new ControlDecoration(text, (SWT.TOP | SWT.LEFT));
+// controlDecoration.setMarginWidth(0);
+// controlDecoration.setShowHover(true);
+// controlDecoration.setShowOnlyOnFocus(true);
+//
+// FieldDecoration contentProposalImage = FieldDecorationRegistry.getDefault().getFieldDecoration(
+// FieldDecorationRegistry.DEC_CONTENT_PROPOSAL);
+// controlDecoration.setImage(contentProposalImage.getImage());
TextContentAdapter textContentAdapter = new TextContentAdapter();
ContentAssistCommandAdapter adapter = new ContentAssistCommandAdapter(text, textContentAdapter,
proposalProvider, "org.eclipse.ui.edit.text.contentAssist.proposals", new char[0]);
- IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
- controlDecoration.setDescriptionText(NLS.bind("Content Assist Available ({0})",
- bindingService.getBestActiveBindingFormattedFor(adapter.getCommandId())));
+// IBindingService bindingService = (IBindingService) PlatformUI.getWorkbench().getService(IBindingService.class);
+// controlDecoration.setDescriptionText(NLS.bind("Content Assist Available ({0})",
+// bindingService.getBestActiveBindingFormattedFor(adapter.getCommandId())));
return adapter;
}
@@ -1771,7 +1766,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
foundNew = true;
}
- expandableComposite.setTitleBarForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ expandableComposite.setTitleBarForeground(toolkit.getColors().getColor(FormColors.TITLE));
// expandableComposite.setText(taskComment.getNumber() + ": " + taskComment.getAuthorName() + ", "
// + formatDate(taskComment.getCreated()));
@@ -1792,7 +1787,7 @@ public abstract class AbstractRepositoryTaskEditor extends TaskFormPage {
ImageHyperlink formHyperlink = toolkit.createImageHyperlink(toolbarComp, SWT.NONE);
formHyperlink.setBackground(null);
formHyperlink.setFont(expandableComposite.getFont());
- formHyperlink.setForeground(toolkit.getColors().getColor(IFormColors.TITLE));
+ formHyperlink.setForeground(toolkit.getColors().getColor(FormColors.TITLE));
if (taskComment.getAuthor().equalsIgnoreCase(repository.getUserName())) {
formHyperlink.setImage(TasksUiImages.getImage(TasksUiImages.PERSON_ME_NARROW));
} else {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
index 0b53d4c17..1728c56ad 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/editors/TaskEditor.java
@@ -17,7 +17,7 @@ import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.jface.action.IMenuListener;
import org.eclipse.jface.action.IMenuManager;
import org.eclipse.jface.action.MenuManager;
-import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.jface.viewers.ISelection;
import org.eclipse.jface.viewers.StructuredSelection;
import org.eclipse.mylyn.internal.tasks.core.LocalTask;
@@ -37,11 +37,9 @@ import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
import org.eclipse.ui.PartInitException;
-import org.eclipse.ui.forms.IManagedForm;
+import org.eclipse.ui.forms.editor.FormEditor;
import org.eclipse.ui.forms.editor.FormPage;
import org.eclipse.ui.forms.editor.IFormPage;
-import org.eclipse.ui.forms.editor.SharedHeaderFormEditor;
-import org.eclipse.ui.forms.widgets.Form;
import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
/**
@@ -49,7 +47,7 @@ import org.eclipse.ui.progress.IWorkbenchSiteProgressService;
* @author Eric Booth (initial prototype)
* @author Rob Elves
*/
-public final class TaskEditor extends SharedHeaderFormEditor implements IBusyEditor {
+public final class TaskEditor extends FormEditor implements IBusyEditor {
public static final String ID_EDITOR = "org.eclipse.mylyn.tasks.ui.editors.task";
@@ -348,7 +346,7 @@ public final class TaskEditor extends SharedHeaderFormEditor implements IBusyEdi
// setContentDescription(name);
setPartName(name);
setTitleToolTip(name);
- updateFormTitle();
+// updateFormTitle();
}
@Override
@@ -379,57 +377,55 @@ public final class TaskEditor extends SharedHeaderFormEditor implements IBusyEdi
}
}
- @Override
- protected void createHeaderContents(IManagedForm headerForm) {
- getToolkit().decorateFormHeading(headerForm.getForm().getForm());
- headerForm.getForm().setImage(TasksUiImages.getImage(TasksUiImages.TASK));
- updateFormTitle();
- }
-
- protected void updateFormTitle() {
- IEditorInput input = getEditorInput();
- if (input instanceof TaskEditorInput) {
- AbstractTask task = ((TaskEditorInput) input).getTask();
- if (task instanceof LocalTask) {
- getHeaderForm().getForm().setText("Task: " + task.getSummary());
- } else {
- setFormHeaderImage(task.getConnectorKind());
- setFormHeaderLabel(task);
- return;
- }
- } else if (input instanceof RepositoryTaskEditorInput) {
- AbstractTask task = ((RepositoryTaskEditorInput) input).getRepositoryTask();
- if (task != null) {
- setFormHeaderImage(task.getConnectorKind());
- setFormHeaderLabel(task);
- return;
- } else {
- RepositoryTaskData data = ((RepositoryTaskEditorInput) input).getTaskData();
- if (data != null) {
- setFormHeaderImage(data.getRepositoryKind());
- setFormHeaderLabel(data);
- }
- }
- }
- }
-
- private void setFormHeaderImage(String repositoryKind) {
- ImageDescriptor overlay = TasksUiPlugin.getDefault().getOverlayIcon(repositoryKind);
- Image image = TasksUiImages.getImageWithOverlay(TasksUiImages.REPOSITORY, overlay, false, false);
- if (getHeaderForm() != null) {
- getHeaderForm().getForm().setImage(image);
- }
- }
-
- public Form getTopForm() {
- return this.getHeaderForm().getForm().getForm();
- }
+// @Override
+// protected void createHeaderContents(IManagedForm headerForm) {
+// getToolkit().decorateFormHeading(headerForm.getForm().getForm());
+// headerForm.getForm().setImage(TasksUiImages.getImage(TasksUiImages.TASK));
+// updateFormTitle();
+// }
+
+// protected void updateFormTitle() {
+// IEditorInput input = getEditorInput();
+// if (input instanceof TaskEditorInput) {
+// AbstractTask task = ((TaskEditorInput) input).getTask();
+// if (task instanceof LocalTask) {
+// getHeaderForm().getForm().setText("Task: " + task.getSummary());
+// } else {
+// setFormHeaderImage(task.getConnectorKind());
+// setFormHeaderLabel(task);
+// return;
+// }
+// } else if (input instanceof RepositoryTaskEditorInput) {
+// AbstractTask task = ((RepositoryTaskEditorInput) input).getRepositoryTask();
+// if (task != null) {
+// setFormHeaderImage(task.getConnectorKind());
+// setFormHeaderLabel(task);
+// return;
+// } else {
+// RepositoryTaskData data = ((RepositoryTaskEditorInput) input).getTaskData();
+// if (data != null) {
+// setFormHeaderImage(data.getRepositoryKind());
+// setFormHeaderLabel(data);
+// }
+// }
+// }
+// }
+
+// private void setFormHeaderImage(String repositoryKind) {
+// ImageDescriptor overlay = TasksUiPlugin.getDefault().getOverlayIcon(repositoryKind);
+// Image image = TasksUiImages.getImageWithOverlay(TasksUiImages.REPOSITORY, overlay, false, false);
+// if (getHeaderForm() != null) {
+// getHeaderForm().getForm().setImage(image);
+// }
+// }
+//
+// public Form getTopForm() {
+// return this.getHeaderForm().getForm().getForm();
+// }
public void setMessage(String message, int type) {
- if (this.getHeaderForm() != null && this.getHeaderForm().getForm() != null) {
- if (!this.getHeaderForm().getForm().isDisposed()) {
- this.getHeaderForm().getForm().setMessage(message, type);
- }
+ if (message != null) {
+ MessageDialog.openInformation(getSite().getShell(), "Task Editor", message);
}
}
@@ -440,54 +436,54 @@ public final class TaskEditor extends SharedHeaderFormEditor implements IBusyEdi
return null;
}
- private void setFormHeaderLabel(RepositoryTaskData taskData) {
-
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(taskData.getRepositoryKind());
-
- String kindLabel = taskData.getTaskKind();
-
- if (connectorUi != null) {
- kindLabel = connectorUi.getTaskKindLabel(taskData);
- }
-
- String idLabel = taskData.getTaskKey();
-
- if (taskData.isNew()) {
- if (connectorUi != null) {
- kindLabel = "New " + connectorUi.getTaskKindLabel(taskData);
- } else {
- kindLabel = "New " + taskData.getTaskKind();
- }
- idLabel = "";
- }
-
- if (idLabel != null) {
- if (getHeaderForm().getForm() != null) {
- getHeaderForm().getForm().setText(kindLabel + " " + idLabel);
- }
- } else if (getHeaderForm().getForm() != null) {
- getHeaderForm().getForm().setText(kindLabel);
- }
- }
-
- private void setFormHeaderLabel(AbstractTask repositoryTask) {
-
- AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repositoryTask.getConnectorKind());
- String kindLabel = "";
- if (connectorUi != null) {
- kindLabel = connectorUi.getTaskKindLabel(repositoryTask);
- }
-
- String idLabel = repositoryTask.getTaskKey();
-
- if (idLabel != null) {
- if (getHeaderForm().getForm() != null) {
- getHeaderForm().getForm().setText(kindLabel + " " + idLabel);
- }
- } else if (getHeaderForm().getForm() != null) {
- getHeaderForm().getForm().setText(kindLabel);
- }
- }
+// private void setFormHeaderLabel(RepositoryTaskData taskData) {
+//
+// AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(taskData.getRepositoryKind());
+//
+// String kindLabel = taskData.getTaskKind();
+//
+// if (connectorUi != null) {
+// kindLabel = connectorUi.getTaskKindLabel(taskData);
+// }
+//
+// String idLabel = taskData.getTaskKey();
+//
+// if (taskData.isNew()) {
+// if (connectorUi != null) {
+// kindLabel = "New " + connectorUi.getTaskKindLabel(taskData);
+// } else {
+// kindLabel = "New " + taskData.getTaskKind();
+// }
+// idLabel = "";
+// }
+//
+// if (idLabel != null) {
+// if (getHeaderForm().getForm() != null) {
+// getHeaderForm().getForm().setText(kindLabel + " " + idLabel);
+// }
+// } else if (getHeaderForm().getForm() != null) {
+// getHeaderForm().getForm().setText(kindLabel);
+// }
+// }
+
+// private void setFormHeaderLabel(AbstractTask repositoryTask) {
+//
+// AbstractRepositoryConnectorUi connectorUi = TasksUiPlugin.getConnectorUi(repositoryTask.getConnectorKind());
+// String kindLabel = "";
+// if (connectorUi != null) {
+// kindLabel = connectorUi.getTaskKindLabel(repositoryTask);
+// }
+//
+// String idLabel = repositoryTask.getTaskKey();
+//
+// if (idLabel != null) {
+// if (getHeaderForm().getForm() != null) {
+// getHeaderForm().getForm().setText(kindLabel + " " + idLabel);
+// }
+// } else if (getHeaderForm().getForm() != null) {
+// getHeaderForm().getForm().setText(kindLabel);
+// }
+// }
@Override
public void setTitleImage(Image titleImage) {
diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
index f44b36f98..c7de831df 100644
--- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
+++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasks/ui/wizards/AbstractRepositorySettingsPage.java
@@ -48,17 +48,14 @@ import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Label;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.forms.events.ExpansionAdapter;
import org.eclipse.ui.forms.events.ExpansionEvent;
import org.eclipse.ui.forms.events.HyperlinkAdapter;
import org.eclipse.ui.forms.events.HyperlinkEvent;
-import org.eclipse.ui.forms.events.IHyperlinkListener;
import org.eclipse.ui.forms.widgets.ExpandableComposite;
import org.eclipse.ui.forms.widgets.FormToolkit;
import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.forms.widgets.Section;
-import org.eclipse.ui.internal.net.ProxyPreferencePage;
/**
* Extend to provide custom repository settings. This page is typically invoked by the user requesting properties via
@@ -674,25 +671,25 @@ public abstract class AbstractRepositorySettingsPage extends WizardPage {
systemProxyButton = new Button(settingsComposite, SWT.CHECK);
GridDataFactory.fillDefaults().align(SWT.LEFT, SWT.TOP).span(2, SWT.DEFAULT).applyTo(settingsComposite);
- systemProxyButton.setText("Use global Network Connections preferences");
- Hyperlink changeProxySettingsLink = toolkit.createHyperlink(settingsComposite, "Change Settings", SWT.NULL);
- changeProxySettingsLink.setBackground(compositeContainer.getBackground());
- changeProxySettingsLink.addHyperlinkListener(new IHyperlinkListener() {
-
- public void linkActivated(HyperlinkEvent e) {
- ProxyPreferencePage page = new ProxyPreferencePage();
- page.init(PlatformUI.getWorkbench());
- TasksUiUtil.showPreferencePage(PREFS_PAGE_ID_NET_PROXY, page);
- }
-
- public void linkEntered(HyperlinkEvent e) {
- // ignore
- }
-
- public void linkExited(HyperlinkEvent e) {
- // ignore
- }
- });
+// systemProxyButton.setText("Use global Network Connections preferences");
+// Hyperlink changeProxySettingsLink = toolkit.createHyperlink(settingsComposite, "Change Settings", SWT.NULL);
+// changeProxySettingsLink.setBackground(compositeContainer.getBackground());
+// changeProxySettingsLink.addHyperlinkListener(new IHyperlinkListener() {
+//
+// public void linkActivated(HyperlinkEvent e) {
+// ProxyPreferencePage page = new ProxyPreferencePage();
+// page.init(PlatformUI.getWorkbench());
+// TasksUiUtil.showPreferencePage(PREFS_PAGE_ID_NET_PROXY, page);
+// }
+//
+// public void linkEntered(HyperlinkEvent e) {
+// // ignore
+// }
+//
+// public void linkExited(HyperlinkEvent e) {
+// // ignore
+// }
+// });
systemProxyButton.addSelectionListener(new SelectionListener() {
public void widgetSelected(SelectionEvent e) {

Back to the top