Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsminto2005-07-12 18:53:23 -0400
committersminto2005-07-12 18:53:23 -0400
commitbe3f7f6ab9e002af2321a0c1858251ba98df0441 (patch)
tree7425714aa886f109fff60395b19da18ebd586f96 /org.eclipse.mylyn.bugzilla.ui
parent3059c812ee26d2a7374a7d4d7d11b1227148a900 (diff)
downloadorg.eclipse.mylyn.tasks-be3f7f6ab9e002af2321a0c1858251ba98df0441.tar.gz
org.eclipse.mylyn.tasks-be3f7f6ab9e002af2321a0c1858251ba98df0441.tar.xz
org.eclipse.mylyn.tasks-be3f7f6ab9e002af2321a0c1858251ba98df0441.zip
Fixed Bug #102682: improve new comment text area
Fixed Bug #102852: provide link to bug report in editor
Diffstat (limited to 'org.eclipse.mylyn.bugzilla.ui')
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/META-INF/MANIFEST.MF4
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java97
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java34
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/AbstractOfflineReportsAction.java57
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/DeleteOfflineReportAction.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/ViewOfflineReportAction.java1
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java128
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java152
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/NewBugEditor.java79
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/AddToFavoritesAction.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/outline/BugzillaOutlineNode.java2
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractBugWizard.java3
-rw-r--r--org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractWizardDataPage.java6
14 files changed, 333 insertions, 235 deletions
diff --git a/org.eclipse.mylyn.bugzilla.ui/META-INF/MANIFEST.MF b/org.eclipse.mylyn.bugzilla.ui/META-INF/MANIFEST.MF
index b7431aebd..67c3e646e 100644
--- a/org.eclipse.mylyn.bugzilla.ui/META-INF/MANIFEST.MF
+++ b/org.eclipse.mylyn.bugzilla.ui/META-INF/MANIFEST.MF
@@ -13,7 +13,9 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.search,
org.eclipse.ui.views,
org.eclipse.ui.ide,
- org.eclipse.mylar.bugzilla.core
+ org.eclipse.mylar.bugzilla.core,
+ org.eclipse.ui.browser,
+ org.eclipse.ui.forms
Eclipse-AutoStart: true
Export-Package: org.eclipse.mylar.bugzilla.ui,
org.eclipse.mylar.bugzilla.ui.actions,
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
new file mode 100644
index 000000000..b5a5ee8c8
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaImages.java
@@ -0,0 +1,97 @@
+/*******************************************************************************
+ * Copyright (c) 2003 - 2005 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.mylar.bugzilla.ui;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.swt.graphics.Image;
+
+/**
+ * This class provides convenience access to many of the resources required
+ * by the workbench. The class stores some images as descriptors, and
+ * some are stored as real Images in the registry. This is a pure
+ * speed-space tradeoff. The trick for users of this class is that
+ * images obtained from the registry (using getImage()), don't require
+ * disposal since they are shared, while images obtained using
+ * getImageDescriptor() will require disposal. Consult the declareImages
+ * method to see if a given image is declared as a registry image or
+ * just as a descriptor. If you change an image from being stored
+ * as a descriptor to a registry image, or vice-versa, make sure to
+ * check all users of the image to ensure they are calling
+ * the correct getImage... method and handling disposal correctly.
+ *
+ * Images:
+ * - use getImage(key) to access cached images from the registry.
+ * - Less common images are found by calling getImageDescriptor(key)
+ * where key can be found in IWorkbenchGraphicConstants
+ *
+ * This class initializes the image registry by declaring all of the required
+ * graphics. This involves creating image descriptors describing
+ * how to create/find the image should it be needed.
+ * The image is not actually allocated until requested.
+ *
+ * Some Images are also made available to other plugins by being
+ * placed in the descriptor table of the SharedImages class.
+ *
+ * Where are the images?
+ * The images (typically gifs) are found the plugins install directory
+ *
+ * How to add a new image
+ * Place the gif file into the appropriate directories.
+ * Add a constant to IWorkbenchGraphicConstants following the conventions
+ * Add the declaration to this file
+ */
+public class BugzillaImages {
+
+ private static Map<ImageDescriptor, Image> imageMap = new HashMap<ImageDescriptor, Image>();
+
+ private static final URL baseURL = BugzillaUiPlugin.getDefault().getBundle().getEntry("/icons/");
+ public static final String T_ELCL = "elcl16";
+
+ public static final ImageDescriptor IMG_TOOL_ADD_TO_FAVORITES = create(T_ELCL, "bug-favorite.gif");
+ public static final ImageDescriptor BUG = create(T_ELCL, "bug.gif");
+ public static final ImageDescriptor IMG_COMMENT = create(T_ELCL, "bug-comment.gif");
+
+ private static ImageDescriptor create(String prefix, String name) {
+ try {
+ return ImageDescriptor.createFromURL(makeIconFileURL(prefix, name));
+ } catch (MalformedURLException e) {
+ return ImageDescriptor.getMissingImageDescriptor();
+ }
+ }
+
+ private static URL makeIconFileURL(String prefix, String name) throws MalformedURLException {
+ if (baseURL == null)
+ throw new MalformedURLException();
+
+ StringBuffer buffer= new StringBuffer(prefix);
+ buffer.append('/');
+ buffer.append(name);
+ return new URL(baseURL, buffer.toString());
+ }
+
+ /**
+ * Lazily initializes image map.
+ */
+ public static Image getImage(ImageDescriptor imageDescriptor) {
+ Image image = imageMap.get(imageDescriptor);
+ if (image == null) {
+ image = imageDescriptor.createImage();
+ imageMap.put(imageDescriptor, image);
+ }
+ return image;
+ }
+
+}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java
index 88e4a184e..c53775d77 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/BugzillaUITools.java
@@ -1,6 +1,8 @@
package org.eclipse.mylar.bugzilla.ui;
import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
import javax.security.auth.login.LoginException;
@@ -21,10 +23,13 @@ import org.eclipse.search.internal.ui.SearchMessages;
import org.eclipse.search.internal.ui.SearchPlugin;
import org.eclipse.search.internal.ui.util.ExceptionHandler;
import org.eclipse.search.ui.NewSearchUI;
+import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IWorkbenchPage;
import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.browser.IWebBrowser;
+import org.eclipse.ui.internal.browser.WorkbenchBrowserSupport;
public class BugzillaUITools {
@@ -208,7 +213,34 @@ public class BugzillaUITools {
}
}
}
-
+ }
+
+ public static void openUrl(String url) {
+ try {
+ IWebBrowser b = null;
+ int flags = 0;
+ if (WorkbenchBrowserSupport.getInstance()
+ .isInternalWebBrowserAvailable()) {
+ flags = WorkbenchBrowserSupport.AS_EDITOR
+ | WorkbenchBrowserSupport.LOCATION_BAR
+ | WorkbenchBrowserSupport.NAVIGATION_BAR;
+
+ } else {
+ flags = WorkbenchBrowserSupport.AS_EXTERNAL
+ | WorkbenchBrowserSupport.LOCATION_BAR
+ | WorkbenchBrowserSupport.NAVIGATION_BAR;
+ }
+ b = WorkbenchBrowserSupport.getInstance().createBrowser(
+ flags, "org.eclipse.mylar.tasks", "Task",
+ "tasktooltip");
+ b.openURL(new URL(url));
+ } catch (PartInitException e) {
+ MessageDialog.openError( Display.getDefault().getActiveShell(),
+ "Browser init error", "Browser could not be initiated");
+ } catch (MalformedURLException e) {
+ MessageDialog.openError( Display.getDefault().getActiveShell(),
+ "URL not found", "URL Could not be opened");
+ }
}
}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java
index 49faa0438..b33657e64 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/OfflineView.java
@@ -38,8 +38,8 @@ import org.eclipse.jface.viewers.Viewer;
import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
import org.eclipse.mylar.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylar.bugzilla.core.offline.AbstractOfflineReportsAction;
import org.eclipse.mylar.bugzilla.core.offline.OfflineReportsFile;
+import org.eclipse.mylar.bugzilla.ui.actions.AbstractOfflineReportsAction;
import org.eclipse.mylar.bugzilla.ui.actions.DeleteOfflineReportAction;
import org.eclipse.mylar.bugzilla.ui.actions.ViewOfflineReportAction;
import org.eclipse.swt.SWT;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/AbstractOfflineReportsAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/AbstractOfflineReportsAction.java
new file mode 100644
index 000000000..dec0ea4a9
--- /dev/null
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/AbstractOfflineReportsAction.java
@@ -0,0 +1,57 @@
+/*******************************************************************************
+ * Copyright (c) 2003 - 2005 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.mylar.bugzilla.ui.actions;
+
+import java.net.MalformedURLException;
+import java.net.URL;
+
+import org.eclipse.jface.action.Action;
+import org.eclipse.jface.resource.ImageDescriptor;
+import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
+import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
+import org.eclipse.swt.widgets.Shell;
+
+
+/**
+ * Class that contains shared functions for the offline report actions
+ */
+public class AbstractOfflineReportsAction extends Action
+{
+
+ /**
+ * Set the actions icon
+ * @param filename The icons file
+ */
+ protected void setIcon(String filename)
+ {
+ URL url = null;
+ try
+ {
+ // try to change the default icon
+ url = new URL(BugzillaUiPlugin.getDefault().getBundle().getEntry("/"), filename);
+ setImageDescriptor(ImageDescriptor.createFromURL(url));
+ }
+ catch (MalformedURLException e)
+ {
+ // Simply don't change the default icon
+ }
+ }
+
+ /**
+ * Convienience method for getting the current shell
+ * @return The current shell
+ */
+ protected Shell getShell()
+ {
+ return BugzillaPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getShell();
+ }
+
+}
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/DeleteOfflineReportAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/DeleteOfflineReportAction.java
index 93be254d1..301cb1b45 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/DeleteOfflineReportAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/DeleteOfflineReportAction.java
@@ -10,7 +10,6 @@
*******************************************************************************/
package org.eclipse.mylar.bugzilla.ui.actions;
-import org.eclipse.mylar.bugzilla.core.offline.AbstractOfflineReportsAction;
import org.eclipse.mylar.bugzilla.ui.OfflineView;
/**
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/ViewOfflineReportAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/ViewOfflineReportAction.java
index b4bb30c5d..63bb81d2f 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/ViewOfflineReportAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/actions/ViewOfflineReportAction.java
@@ -18,7 +18,6 @@ import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
import org.eclipse.mylar.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.bugzilla.core.NewBugModel;
-import org.eclipse.mylar.bugzilla.core.offline.AbstractOfflineReportsAction;
import org.eclipse.mylar.bugzilla.ui.OfflineView;
import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditorInput;
import org.eclipse.mylar.bugzilla.ui.editor.NewBugEditorInput;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
index e3107bc8d..5bc986752 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/AbstractBugEditor.java
@@ -41,12 +41,14 @@ import org.eclipse.mylar.bugzilla.core.Attribute;
import org.eclipse.mylar.bugzilla.core.BugPost;
import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.BugzillaPreferences;
+import org.eclipse.mylar.bugzilla.core.BugzillaRepository;
import org.eclipse.mylar.bugzilla.core.BugzillaTools;
import org.eclipse.mylar.bugzilla.core.Comment;
import org.eclipse.mylar.bugzilla.core.IBugzillaAttributeListener;
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
import org.eclipse.mylar.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.bugzilla.core.IBugzillaReportSelection;
+import org.eclipse.mylar.bugzilla.ui.BugzillaUITools;
import org.eclipse.mylar.bugzilla.ui.OfflineView;
import org.eclipse.mylar.bugzilla.ui.outline.BugzillaOutlineNode;
import org.eclipse.mylar.bugzilla.ui.outline.BugzillaOutlinePage;
@@ -60,6 +62,8 @@ import org.eclipse.swt.events.ControlEvent;
import org.eclipse.swt.events.ControlListener;
import org.eclipse.swt.events.DisposeEvent;
import org.eclipse.swt.events.DisposeListener;
+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.graphics.Color;
@@ -83,6 +87,7 @@ import org.eclipse.ui.IWorkbenchActionConstants;
import org.eclipse.ui.IWorkbenchPart;
import org.eclipse.ui.actions.ActionFactory;
import org.eclipse.ui.actions.RetargetAction;
+import org.eclipse.ui.forms.widgets.Hyperlink;
import org.eclipse.ui.internal.WorkbenchImages;
import org.eclipse.ui.internal.WorkbenchMessages;
import org.eclipse.ui.internal.help.WorkbenchHelpSystem;
@@ -99,10 +104,20 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
protected Display display;
- protected Font titleFont;
-
- protected Font textFont;
-
+ public static final Font TITLE_FONT = JFaceResources.getHeaderFont();
+
+ public static final Font TEXT_FONT = JFaceResources.getDefaultFont();
+
+ public static final Font COMMENT_FONT = new Font(null, "Courier New", 9, SWT.NORMAL);
+
+ public static final Font URL_FONT = new Font(null, "Courier New", 10, SWT.BOLD);
+
+ public static final Font HEADER_FONT = JFaceResources.getDefaultFont();
+
+ public static final int DESCRIPTION_WIDTH = 79 * 7;
+
+ public static final int DESCRIPTION_HEIGHT = 10 * 14;
+
protected Color background;
protected Color foreground;
@@ -185,7 +200,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
protected Composite infoArea;
- protected StyledText generalTitleText;
+ protected Hyperlink generalTitleText;
private List<IBugzillaAttributeListener> attributesListeners = new ArrayList<IBugzillaAttributeListener>();
@@ -248,11 +263,9 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
* cut/copy/paste actions.
*/
public AbstractBugEditor() {
- titleFont = JFaceResources.getHeaderFont();
- textFont = JFaceResources.getDefaultFont();
// set the scroll increments so the editor scrolls normally with the scroll wheel
- FontData[] fd = textFont.getFontData();
+ FontData[] fd = TEXT_FONT.getFontData();
int cushion = 4;
scrollIncrement = fd[0].getHeight() + cushion;
scrollVertPageIncrement = 0;
@@ -372,11 +385,12 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
// Message label
titleLabel = new CLabel(titleArea, SWT.LEFT);
JFaceColors.setColors(titleLabel, foreground, background);
- titleLabel.setFont(titleFont);
+ titleLabel.setFont(TITLE_FONT);
+
final IPropertyChangeListener fontListener = new IPropertyChangeListener() {
public void propertyChange(PropertyChangeEvent event) {
if (JFaceResources.HEADER_FONT.equals(event.getProperty())) {
- titleLabel.setFont(titleFont);
+ titleLabel.setFont(TITLE_FONT);
}
}
};
@@ -398,7 +412,6 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
gd = new GridData();
gd.horizontalAlignment = GridData.END;
titleImage.setLayoutData(gd);
-
return titleArea;
}
@@ -585,7 +598,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
newLayout(attributesComposite, 1, name, PROPERTY);
oSCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND
| SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);
-
+ oSCombo.setFont(TEXT_FONT);
oSCombo.setLayoutData(data);
oSCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -605,7 +618,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
versionCombo = new Combo(attributesComposite, SWT.NO_BACKGROUND
| SWT.MULTI | SWT.V_SCROLL | SWT.READ_ONLY);
-
+ versionCombo.setFont(TEXT_FONT);
versionCombo.setLayoutData(data);
versionCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -626,7 +639,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
priorityCombo = new Combo(attributesComposite,
SWT.NO_BACKGROUND | SWT.MULTI | SWT.V_SCROLL
| SWT.READ_ONLY);
-
+ priorityCombo.setFont(TEXT_FONT);
priorityCombo.setLayoutData(data);
priorityCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -651,6 +664,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
| SWT.V_SCROLL
| SWT.READ_ONLY);
+ severityCombo.setFont(TEXT_FONT);
severityCombo.setLayoutData(data);
severityCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -675,6 +689,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
| SWT.V_SCROLL
| SWT.READ_ONLY);
+ milestoneCombo.setFont(TEXT_FONT);
milestoneCombo.setLayoutData(data);
milestoneCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -699,6 +714,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
| SWT.V_SCROLL
| SWT.READ_ONLY);
+ platformCombo.setFont(TEXT_FONT);
platformCombo.setLayoutData(data);
platformCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -728,6 +744,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
| SWT.V_SCROLL
| SWT.READ_ONLY);
+ componentCombo.setFont(TEXT_FONT);
componentCombo.setLayoutData(data);
componentCombo.setBackground(background);
Set<String> s = values.keySet();
@@ -786,12 +803,13 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
newLayout(attributesComposite, 1, "URL:", PROPERTY);
urlText =
new Text(attributesComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
+ urlText.setFont(TEXT_FONT);
GridData urlTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
urlTextData.horizontalSpan = 3;
urlTextData.widthHint = 200;
urlText.setLayoutData(urlTextData);
urlText.setText(url);
- urlText.addListener(SWT.FocusOut, new Listener() {
+ urlText.addListener(SWT.KeyUp, new Listener() {
public void handleEvent(Event event) {
String sel = urlText.getText();
Attribute a = getBug().getAttribute("URL");
@@ -825,12 +843,13 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
newLayout(attributesComposite, 1, "Summary:", PROPERTY);
summaryText =
new Text(attributesComposite, SWT.BORDER | SWT.SINGLE | SWT.WRAP);
+ summaryText.setFont(TEXT_FONT);
GridData summaryTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
summaryTextData.horizontalSpan = 3;
summaryTextData.widthHint = 200;
summaryText.setLayoutData(summaryTextData);
summaryText.setText(getBug().getSummary());
- summaryText.addListener(SWT.FocusOut, new SummaryListener());
+ summaryText.addListener(SWT.KeyUp, new SummaryListener());
summaryText.addListener(SWT.FocusIn, new GenericListener());
}
@@ -879,8 +898,9 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
*/
protected void addActionButtons(Composite buttonComposite) {
submitButton = new Button(buttonComposite, SWT.NONE);
+ submitButton.setFont(TEXT_FONT);
GridData submitButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- submitButtonData.widthHint = 80;
+ submitButtonData.widthHint = 100;
submitButtonData.heightHint = 20;
submitButton.setText("Submit");
submitButton.setLayoutData(submitButtonData);
@@ -892,8 +912,9 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
submitButton.addListener(SWT.FocusIn, new GenericListener());
saveButton = new Button(buttonComposite, SWT.NONE);
+ saveButton.setFont(TEXT_FONT);
GridData saveButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- saveButtonData.widthHint = 80;
+ saveButtonData.widthHint = 100;
saveButtonData.heightHint = 20;
saveButton.setText("Save Offline");
saveButton.setLayoutData(saveButtonData);
@@ -954,7 +975,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
if (style.equalsIgnoreCase(VALUE)) {
StyledText styledText =
new StyledText(composite, SWT.MULTI | SWT.READ_ONLY);
- styledText.setFont(textFont);
+ styledText.setFont(TEXT_FONT);
styledText.setText(checkText(text));
styledText.setBackground(background);
data.horizontalIndent = HORZ_INDENT;
@@ -985,7 +1006,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
else if (style.equalsIgnoreCase(PROPERTY)) {
StyledText styledText =
new StyledText(composite, SWT.MULTI | SWT.READ_ONLY);
- styledText.setFont(textFont);
+ styledText.setFont(TEXT_FONT);
styledText.setText(checkText(text));
styledText.setBackground(background);
data.horizontalIndent = HORZ_INDENT;
@@ -1029,6 +1050,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
StyledText titleText =
new StyledText(generalTitleGroup, SWT.MULTI | SWT.READ_ONLY);
titleText.setText(checkText(text));
+ titleText.setFont(HEADER_FONT);
titleText.setBackground(background);
StyleRange sr = new StyleRange(
titleText.getOffsetAtLine(0),
@@ -1100,31 +1122,15 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
gd.verticalAlignment = GridData.VERTICAL_ALIGN_BEGINNING;
image.setLayoutData(gd);
generalTitleText =
- new StyledText(generalTitleGroup, SWT.MULTI | SWT.READ_ONLY);
+ new Hyperlink(generalTitleGroup, SWT.MULTI | SWT.READ_ONLY);
setGeneralTitleText();
generalTitleText.setBackground(background);
- generalTitleText.getCaret().setVisible(false);
- generalTitleText.setEditable(false);
- generalTitleText.addSelectionListener(new SelectionAdapter() {
-
- @Override
- public void widgetSelected(SelectionEvent e) {
- StyledText c = (StyledText) e.widget;
- if (c != null && c.getSelectionCount() > 0) {
- if (currentSelectedText != null) {
- if (!c.equals(currentSelectedText)) {
- currentSelectedText.setSelectionRange(0, 0);
- }
- }
- }
- currentSelectedText = c;
- }
- });
+
// create context menu
- generalTitleGroup.setMenu(
- contextMenuManager.createContextMenu(generalTitleGroup));
- generalTitleText.setMenu(
- contextMenuManager.createContextMenu(generalTitleText));
+// generalTitleGroup.setMenu(
+// contextMenuManager.createContextMenu(generalTitleGroup));
+// generalTitleText.setMenu(
+// contextMenuManager.createContextMenu(generalTitleText));
image.setMenu(
contextMenuManager.createContextMenu(image));
composite.setMenu(contextMenuManager.createContextMenu(composite));
@@ -1137,13 +1143,22 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
protected void setGeneralTitleText() {
String text = getTitleString();
generalTitleText.setText(text);
- StyleRange sr = new StyleRange(
- generalTitleText.getOffsetAtLine(0),
- text.length(),
- foreground,
- background,
- SWT.BOLD);
- generalTitleText.setStyleRange(sr);
+ generalTitleText.setFont(URL_FONT);
+ if(this instanceof ExistingBugEditor){
+ generalTitleText.setUnderlined(true);
+ generalTitleText.setForeground(new Color(Display.getCurrent(), 0, 0, 255));
+ generalTitleText.addMouseListener(new MouseListener(){
+
+ public void mouseDoubleClick(MouseEvent e) {}
+ public void mouseUp(MouseEvent e) {}
+
+ public void mouseDown(MouseEvent e) {
+ BugzillaUITools.openUrl(BugzillaRepository.getBugUrlWithoutLogin(bugzillaInput.getBug().getId()));
+ }
+ });
+ } else{
+ generalTitleText.setEnabled(false);
+ }
generalTitleText.addListener(SWT.FocusIn, new GenericListener());
// Resize the composite, in case the new summary is longer than the
@@ -1187,6 +1202,8 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
updateBug();
changeDirtyStatus(false);
OfflineView.saveOffline(getBug());
+ OfflineView.checkWindow();
+ OfflineView.add();
}
/**
@@ -1274,7 +1291,7 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
@Override
public boolean isDirty() {
- return false;
+ return isDirty;
}
/**
@@ -1287,17 +1304,17 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
*/
public void changeDirtyStatus(boolean newDirtyStatus) {
isDirty = newDirtyStatus;
- updateEditorTitle();
+ firePropertyChange(PROP_DIRTY);
}
+
/**
* Updates the title of the editor to reflect dirty status.
* If the bug report has been modified but not saved, then
* an indicator will appear in the title.
*/
protected void updateEditorTitle() {
- String prefix = (isDirty) ? "*" : "" ;
- setPartName(prefix + bugzillaInput.getName());
+ setPartName(bugzillaInput.getName());
}
@Override
@@ -1307,7 +1324,10 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener {
@Override
public void doSave(IProgressMonitor monitor) {
- // we don't save, so no need to implement
+ saveBug();
+ updateEditor();
+
+ // XXX notify that saved ofline?
}
@Override
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java
index 19f1dc193..6bbb4302f 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/ExistingBugEditor.java
@@ -62,15 +62,9 @@ import org.eclipse.swt.widgets.List;
import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
-import org.eclipse.ui.IEditorPart;
import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPartListener;
import org.eclipse.ui.ISharedImages;
-import org.eclipse.ui.IWorkbench;
import org.eclipse.ui.IWorkbenchActionConstants;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
import org.eclipse.ui.PlatformUI;
import org.eclipse.ui.internal.Workbench;
@@ -103,13 +97,6 @@ public class ExistingBugEditor extends AbstractBugEditor
public ExistingBugEditor() {
super();
- // get the workbench page and add a listener so we can detect when it closes
- IWorkbench wb = BugzillaPlugin.getDefault().getWorkbench();
- IWorkbenchWindow aw = wb.getActiveWorkbenchWindow();
- IWorkbenchPage ap = aw.getActivePage();
- BugzillaEditorListener listener = new BugzillaEditorListener();
- ap.addPartListener(listener);
-
// Set up the input for comparing the bug report to the server
CompareConfiguration config = new CompareConfiguration();
config.setLeftEditable(false);
@@ -132,6 +119,7 @@ public class ExistingBugEditor extends AbstractBugEditor
model = BugzillaOutlineNode.parseBugReport(bugzillaInput.getBug());
bug = ei.getBug();
restoreBug();
+ isDirty = false;
updateEditorTitle();
}
@@ -171,27 +159,28 @@ public class ExistingBugEditor extends AbstractBugEditor
@Override
protected void addRadioButtons(Composite buttonComposite) {
int i = 0;
+ Button selected = null;
radios = new Button[bug.getOperations().size()];
radioOptions = new Combo[bug.getAttributes().size()];
for (Iterator<Operation> it = bug.getOperations().iterator(); it.hasNext(); ) {
Operation o = it.next();
radios[i] = new Button(buttonComposite, SWT.RADIO);
+ radios[i].setFont(TEXT_FONT);
GridData radioData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
if (!o.hasOptions())
radioData.horizontalSpan = 4;
else
radioData.horizontalSpan = 3;
radioData.heightHint = 20;
- radios[i].setText(o.getOperationName());
+ String opName = o.getOperationName();
+ opName = opName.replaceAll("</.*>", "");
+ opName = opName.replaceAll("<.*>", "");
+ radios[i].setText(opName);
radios[i].setLayoutData(radioData);
radios[i].setBackground(background);
radios[i].addSelectionListener(new RadioButtonListener());
radios[i].addListener(SWT.FocusIn, new GenericListener());
- if (i == 0 || o.isChecked()) {
- radios[i].setSelection(true);
- bug.setSelectedOperation(o);
- }
-
+
if (o.hasOptions()) {
radioData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
radioData.horizontalSpan = 1;
@@ -203,7 +192,7 @@ public class ExistingBugEditor extends AbstractBugEditor
| SWT.MULTI
| SWT.V_SCROLL
| SWT.READ_ONLY);
-
+ radioOptions[i].setFont(TEXT_FONT);
radioOptions[i].setLayoutData(radioData);
radioOptions[i].setBackground(background);
@@ -215,6 +204,24 @@ public class ExistingBugEditor extends AbstractBugEditor
radioOptions[i].select(0);
radioOptions[i].addSelectionListener(new RadioButtonListener());
}
+
+ if (i == 0 || o.isChecked()) {
+ if(selected != null)
+ selected.setSelection(false);
+ selected = radios[i];
+ radios[i].setSelection(true);
+ if(o.hasOptions() && o.getOptionSelection() != null){
+ int j = 0;
+ for(String s: radioOptions[i].getItems()){
+ if(s.compareTo(o.getOptionSelection()) == 0){
+ radioOptions[i].select(j);
+ }
+ j++;
+ }
+ }
+ bug.setSelectedOperation(o);
+ }
+
i++;
}
}
@@ -224,8 +231,9 @@ public class ExistingBugEditor extends AbstractBugEditor
super.addActionButtons(buttonComposite);
compareButton = new Button(buttonComposite, SWT.NONE);
+ compareButton.setFont(TEXT_FONT);
GridData compareButtonData = new GridData(GridData.HORIZONTAL_ALIGN_BEGINNING);
- compareButtonData.widthHint = 80;
+ compareButtonData.widthHint = 100;
compareButtonData.heightHint = 20;
compareButton.setText("Compare");
compareButton.setLayoutData(compareButtonData);
@@ -334,6 +342,7 @@ public class ExistingBugEditor extends AbstractBugEditor
StyledText t = newLayout(descriptionComposite, 4, "Description:", HEADER);
t.addListener(SWT.FocusIn, new DescriptionListener());
t = newLayout(descriptionComposite, 4, bug.getDescription(), VALUE);
+ t.setFont(COMMENT_FONT);
t.addListener(SWT.FocusIn, new DescriptionListener());
texts.add(textsindex, t);
@@ -367,6 +376,7 @@ public class ExistingBugEditor extends AbstractBugEditor
t = newLayout(addCommentsComposite, 4, commentHeader, HEADER);
t.addListener(SWT.FocusIn, new CommentListener(comment));
t = newLayout(addCommentsComposite, 4, comment.getText(), VALUE);
+ t.setFont(COMMENT_FONT);
t.addListener(SWT.FocusIn, new CommentListener(comment));
//code for outline
@@ -391,20 +401,23 @@ public class ExistingBugEditor extends AbstractBugEditor
newLayout(
addCommentsTitleComposite,
4,
- "New Additional Comment:",
+ "Additional Comments:",
HEADER).addListener(SWT.FocusIn, new NewCommentListener());
addCommentsText =
new Text(
addCommentsComposite,
SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
+ addCommentsText.setFont(COMMENT_FONT);
GridData addCommentsTextData =
new GridData(GridData.HORIZONTAL_ALIGN_FILL);
addCommentsTextData.horizontalSpan = 4;
- addCommentsTextData.widthHint = 250;
- addCommentsTextData.heightHint = 100;
+ addCommentsTextData.widthHint = DESCRIPTION_WIDTH;
+ addCommentsTextData.heightHint = DESCRIPTION_HEIGHT;
+
addCommentsText.setLayoutData(addCommentsTextData);
addCommentsText.setText(bug.getNewComment());
- addCommentsText.addListener(SWT.FocusOut, new Listener() {
+ addCommentsText.addListener(SWT.KeyUp, new Listener() {
+
public void handleEvent(Event event) {
String sel = addCommentsText.getText();
if (!(bug.getNewNewComment().equals(sel))) {
@@ -420,11 +433,12 @@ public class ExistingBugEditor extends AbstractBugEditor
this.createSeparatorSpace(addCommentsComposite);
}
-
+
@Override
protected void addKeywordsList(String keywords, Composite attributesComposite) {
newLayout(attributesComposite, 1, "Keywords:", PROPERTY);
keywordsText = new Text(attributesComposite, SWT.BORDER);
+ keywordsText.setFont(TEXT_FONT);
keywordsText.setEditable(false);
keywordsText.setForeground(foreground);
keywordsText.setBackground(JFaceColors.getErrorBackground(display));
@@ -435,6 +449,7 @@ public class ExistingBugEditor extends AbstractBugEditor
keywordsText.setText(keywords);
keywordsText.addListener(SWT.FocusIn, new GenericListener());
keyWordsList = new List(attributesComposite, SWT.MULTI | SWT.V_SCROLL | SWT.BORDER);
+ keyWordsList.setFont(TEXT_FONT);
GridData keyWordsTextData =
new GridData(GridData.HORIZONTAL_ALIGN_FILL);
keyWordsTextData.horizontalSpan = 1;
@@ -481,7 +496,7 @@ public class ExistingBugEditor extends AbstractBugEditor
Attribute a = it.next();
a.setValue(a.getNewValue());
}
-
+
// Update some other fields as well.
bug.setNewComment(bug.getNewNewComment());
@@ -540,75 +555,6 @@ public class ExistingBugEditor extends AbstractBugEditor
}
}
-
- /**
- * Class to listen for editor events.
- */
- protected class BugzillaEditorListener implements IPartListener
- {
-
- /**
- * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- // no need to listen to this
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // no need to listen to this
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
-
- if (part instanceof ExistingBugEditor) {
-
- ExistingBugEditor editor = (ExistingBugEditor)part;
-
- // check if the bug editor needs to be saved
- if (editor.isDirty) {
- // ask the user whether they want to save it or not and perform the appropriate action
- editor.changeDirtyStatus(false);
- boolean response = MessageDialog.openQuestion(null, "Save Changes",
- "You have made some changes to the bug, do you want to save them?");
- if (response) {
- editor.saveBug();
- }
- }
-
- // get the active workbench page
- IWorkbenchPage page = BugzillaPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage();
-
- if (page != null) {
- // Close the compare editor, if there is one
- IEditorPart compareEditor = page.findEditor(getCompareInput());
- if (compareEditor != null) {
- page.closeEditor(compareEditor, false);
- }
- }
-
- }
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- // no need to listen to this
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- // no need to listen to this
- }
- }
/**
* Class to handle the selection change of the keywords.
@@ -711,19 +657,29 @@ public class ExistingBugEditor extends AbstractBugEditor
}
// determine the operation to do to the bug
for (int i = 0; i < radios.length; i++) {
- if (radios[i] != e.widget && radios[i] != selected)
+ if (radios[i] != e.widget && radios[i] != selected){
radios[i].setSelection(false);
+ }
+
if (e.widget == radios[i]) {
Operation o = bug.getOperation(radios[i].getText());
bug.setSelectedOperation(o);
+ ExistingBugEditor.this.changeDirtyStatus(true);
}
else if(e.widget == radioOptions[i]) {
Operation o = bug.getOperation(radios[i].getText());
o.setOptionSelection(radioOptions[i].getItem(radioOptions[i].getSelectionIndex()));
+
+ if(bug.getSelectedOperation() != null)
+ bug.getSelectedOperation().setChecked(false);
+ o.setChecked(true);
+
bug.setSelectedOperation(o);
radios[i].setSelection(true);
- if(selected != null && selected != radios[i])
+ if(selected != null && selected != radios[i]){
selected.setSelection(false);
+ }
+ ExistingBugEditor.this.changeDirtyStatus(true);
}
}
if(addCommentsText.getText() == null || addCommentsText.getText().equals("")){
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/NewBugEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/NewBugEditor.java
index 375b840d7..c068463e1 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/NewBugEditor.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/editor/NewBugEditor.java
@@ -35,11 +35,6 @@ import org.eclipse.swt.widgets.Listener;
import org.eclipse.swt.widgets.Text;
import org.eclipse.ui.IEditorInput;
import org.eclipse.ui.IEditorSite;
-import org.eclipse.ui.IPartListener;
-import org.eclipse.ui.IWorkbench;
-import org.eclipse.ui.IWorkbenchPage;
-import org.eclipse.ui.IWorkbenchPart;
-import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PartInitException;
@@ -59,13 +54,6 @@ public class NewBugEditor extends AbstractBugEditor {
*/
public NewBugEditor() {
super();
-
- // get the workbench page and add a listener so we can detect when it closes
- IWorkbench wb = BugzillaPlugin.getDefault().getWorkbench();
- IWorkbenchWindow aw = wb.getActiveWorkbenchWindow();
- IWorkbenchPage ap = aw.getActivePage();
- BugzillaEditorListener listener = new BugzillaEditorListener();
- ap.addPartListener(listener);
}
@Override
@@ -111,15 +99,16 @@ public class NewBugEditor extends AbstractBugEditor {
descriptionText =
new Text(descriptionComposite,
SWT.BORDER | SWT.MULTI | SWT.WRAP | SWT.V_SCROLL);
+ descriptionText.setFont(COMMENT_FONT);
GridData descriptionTextData = new GridData(GridData.HORIZONTAL_ALIGN_FILL);
descriptionTextData.horizontalSpan = 4;
- descriptionTextData.widthHint = 250;
- descriptionTextData.heightHint = 100;
+ descriptionTextData.widthHint = DESCRIPTION_WIDTH;
+ descriptionTextData.heightHint = DESCRIPTION_HEIGHT;
descriptionText.setLayoutData(descriptionTextData);
descriptionText.setText(bug.getDescription());
- descriptionText.addListener(SWT.FocusOut, new Listener() {
+ descriptionText.addListener(SWT.KeyUp, new Listener() {
public void handleEvent(Event event) {
- String sel = descriptionText.getText();
+ String sel = descriptionText.getText() + event.character;
if (!(newDescription.equals(sel))) {
newDescription = sel;
changeDirtyStatus(true);
@@ -280,67 +269,11 @@ public class NewBugEditor extends AbstractBugEditor {
newSummary = bug.getSummary();
newDescription = bug.getDescription();
restoreBug();
+ isDirty = false;
updateEditorTitle();
}
/**
- * Class to listen for editor events.
- */
- protected class BugzillaEditorListener implements IPartListener
- {
-
- /**
- * @see org.eclipse.ui.IPartListener#partActivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partActivated(IWorkbenchPart part) {
- // don't need to listen to this
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partBroughtToTop(org.eclipse.ui.IWorkbenchPart)
- */
- public void partBroughtToTop(IWorkbenchPart part) {
- // don't need to listen to this
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partClosed(org.eclipse.ui.IWorkbenchPart)
- */
- public void partClosed(IWorkbenchPart part) {
-
- if (part instanceof NewBugEditor) {
-
- NewBugEditor editor = (NewBugEditor)part;
-
- // check if the bug editor needs to be saved
- if (editor.isDirty) {
- // ask the user whether they want to save it or not and perform the appropriate action
- editor.changeDirtyStatus(false);
- boolean response = MessageDialog.openQuestion(null, "Save Changes",
- "You have made some changes to the bug, do you want to save them?");
- if (response) {
- editor.saveBug();
- }
- }
- }
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partDeactivated(org.eclipse.ui.IWorkbenchPart)
- */
- public void partDeactivated(IWorkbenchPart part) {
- // don't need to listen to this
- }
-
- /**
- * @see org.eclipse.ui.IPartListener#partOpened(org.eclipse.ui.IWorkbenchPart)
- */
- public void partOpened(IWorkbenchPart part) {
- // don't need to listen to this
- }
- }
-
- /**
* A listener for selection of the description textbox.
*/
protected class DescriptionListener implements Listener {
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/AddToFavoritesAction.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/AddToFavoritesAction.java
index 524999d11..0e8a634a3 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/AddToFavoritesAction.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/favorites/actions/AddToFavoritesAction.java
@@ -11,9 +11,9 @@
package org.eclipse.mylar.bugzilla.ui.favorites.actions;
import org.eclipse.jface.action.Action;
-import org.eclipse.mylar.bugzilla.core.BugzillaImages;
import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.favorites.Favorite;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.mylar.bugzilla.ui.FavoritesView;
import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditorInput;
import org.eclipse.ui.part.EditorPart;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/outline/BugzillaOutlineNode.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/outline/BugzillaOutlineNode.java
index 4336e4e82..a84479854 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/outline/BugzillaOutlineNode.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/outline/BugzillaOutlineNode.java
@@ -14,11 +14,11 @@ import java.util.ArrayList;
import java.util.Iterator;
import org.eclipse.mylar.bugzilla.core.BugReport;
-import org.eclipse.mylar.bugzilla.core.BugzillaImages;
import org.eclipse.mylar.bugzilla.core.Comment;
import org.eclipse.mylar.bugzilla.core.IBugzillaBug;
import org.eclipse.mylar.bugzilla.core.IBugzillaReportSelection;
import org.eclipse.mylar.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.bugzilla.ui.BugzillaImages;
import org.eclipse.swt.graphics.Image;
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractBugWizard.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractBugWizard.java
index 76c07dffb..4190b5edd 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractBugWizard.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractBugWizard.java
@@ -26,6 +26,7 @@ import org.eclipse.mylar.bugzilla.core.BugzillaPlugin;
import org.eclipse.mylar.bugzilla.core.BugzillaPreferences;
import org.eclipse.mylar.bugzilla.core.IBugzillaConstants;
import org.eclipse.mylar.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin;
import org.eclipse.mylar.bugzilla.ui.editor.ExistingBugEditorInput;
import org.eclipse.search.internal.ui.SearchMessages;
import org.eclipse.search.internal.ui.util.ExceptionHandler;
@@ -65,7 +66,7 @@ public abstract class AbstractBugWizard extends Wizard implements INewWizard {
super();
model = new NewBugModel();
id = null; // Since there is no bug posted yet.
- super.setDefaultPageImageDescriptor(BugzillaPlugin.imageDescriptorFromPlugin(IBugzillaConstants.PLUGIN_ID, "icons/wizban/bug-wizard.gif"));
+ super.setDefaultPageImageDescriptor(BugzillaUiPlugin.imageDescriptorFromPlugin("org.eclipse.mylar.bugzilla.ui", "icons/wizban/bug-wizard.gif"));
}
/*
diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractWizardDataPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractWizardDataPage.java
index 777231a25..8e423c5d3 100644
--- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractWizardDataPage.java
+++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/AbstractWizardDataPage.java
@@ -21,6 +21,7 @@ import org.eclipse.jface.wizard.IWizardPage;
import org.eclipse.jface.wizard.WizardPage;
import org.eclipse.mylar.bugzilla.core.Attribute;
import org.eclipse.mylar.bugzilla.core.NewBugModel;
+import org.eclipse.mylar.bugzilla.ui.editor.AbstractBugEditor;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.graphics.FontData;
@@ -579,11 +580,12 @@ public abstract class AbstractWizardDataPage extends WizardPage implements
descriptionText = new Text(attributesComposite, SWT.BORDER | SWT.MULTI
| SWT.WRAP | SWT.V_SCROLL);
+ descriptionText.setFont(AbstractBugEditor.COMMENT_FONT);
GridData descriptionTextData = new GridData(
GridData.HORIZONTAL_ALIGN_FILL);
descriptionTextData.horizontalSpan = 4;
- descriptionTextData.widthHint = 200;
- descriptionTextData.heightHint = 100;
+ descriptionTextData.widthHint = AbstractBugEditor.DESCRIPTION_WIDTH;
+ descriptionTextData.heightHint = AbstractBugEditor.DESCRIPTION_HEIGHT;
descriptionText.setLayoutData(descriptionTextData);
descriptionText.addListener(SWT.Modify, this);

Back to the top