diff options
author | mkersten | 2005-11-04 21:19:12 +0000 |
---|---|---|
committer | mkersten | 2005-11-04 21:19:12 +0000 |
commit | e22519ca0e9999a69c25435efd31f89c774867c2 (patch) | |
tree | 6afb7603be4e6540f250f35d234a5361a9dc476e | |
parent | cfdffb680b35cb357ad820597dfcfa6afef307e3 (diff) | |
download | org.eclipse.mylyn.tasks-e22519ca0e9999a69c25435efd31f89c774867c2.tar.gz org.eclipse.mylyn.tasks-e22519ca0e9999a69c25435efd31f89c774867c2.tar.xz org.eclipse.mylyn.tasks-e22519ca0e9999a69c25435efd31f89c774867c2.zip |
Progress on Bugzilla Bug 115017: bugzilla 2.20 hits only result in one match
23 files changed, 427 insertions, 248 deletions
diff --git a/org.eclipse.mylyn.bugzilla.core/plugin.xml b/org.eclipse.mylyn.bugzilla.core/plugin.xml index 364a83782..21547b90f 100644 --- a/org.eclipse.mylyn.bugzilla.core/plugin.xml +++ b/org.eclipse.mylyn.bugzilla.core/plugin.xml @@ -24,7 +24,7 @@ <extension point="org.eclipse.ui.preferencePages"> <page name="Bugzilla" - class="org.eclipse.mylar.bugzilla.core.BugzillaPreferences" + class="org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage" id="org.eclipse.mylar.bugzilla.bugzillaPreferences" category="org.eclipse.mylar.ui.preferences"/> </extension> diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPlugin.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPlugin.java index 5ce02058f..260d2b765 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPlugin.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPlugin.java @@ -114,7 +114,6 @@ public class BugzillaPlugin extends AbstractUIPlugin { super.stop(context); } - /** * Get the favorites file contatining the favorites * @@ -138,7 +137,7 @@ public class BugzillaPlugin extends AbstractUIPlugin { @Override protected void initializeDefaultPreferences(IPreferenceStore store) { - BugzillaPreferences.initDefaults(store); + BugzillaPreferencePage.initDefaults(store); } /** @@ -146,11 +145,19 @@ public class BugzillaPlugin extends AbstractUIPlugin { * * @return A string containing the prefered name of the bugzilla server */ - public String getServerName() - { + public String getServerName() { return plugin.getPreferenceStore().getString(IBugzillaConstants.BUGZILLA_SERVER); } + public boolean isServerCompatability218(){ + return IBugzillaConstants.SERVER_218.equals(getPreferenceStore().getString(IBugzillaConstants.SERVER_218)) + || IBugzillaConstants.SERVER_218.equals(getPreferenceStore().getString(IBugzillaConstants.SERVER_220)); + } + + public boolean isServerCompatability220(){ + return IBugzillaConstants.SERVER_218.equals(getPreferenceStore().getString(IBugzillaConstants.SERVER_220)); + } + /** * Get the most recent query key for the preferences * diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPreferences.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPreferencePage.java index 97a8e2af3..ce996732c 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPreferences.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaPreferencePage.java @@ -32,11 +32,14 @@ import org.eclipse.jface.preference.BooleanFieldEditor; import org.eclipse.jface.preference.FieldEditorPreferencePage; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.preference.IntegerFieldEditor; +import org.eclipse.jface.preference.RadioGroupFieldEditor; import org.eclipse.jface.preference.StringFieldEditor; import org.eclipse.mylar.bugzilla.core.internal.ProductConfiguration; import org.eclipse.mylar.bugzilla.core.internal.ProductConfigurationFactory; import org.eclipse.mylar.bugzilla.core.search.BugzillaQueryPageParser; +import org.eclipse.swt.widgets.Button; import org.eclipse.swt.widgets.Composite; +import org.eclipse.swt.widgets.Control; import org.eclipse.swt.widgets.Text; import org.eclipse.ui.IWorkbench; import org.eclipse.ui.IWorkbenchPreferencePage; @@ -50,7 +53,7 @@ import org.eclipse.ui.IWorkbenchPreferencePage; /** * The class that deals with the preferences page in eclipse */ -public class BugzillaPreferences +public class BugzillaPreferencePage extends FieldEditorPreferencePage implements IWorkbenchPreferencePage { @@ -70,26 +73,22 @@ public class BugzillaPreferences private static final String bugzillaPasswordLabel = "Bugzilla Password: "; + private RadioGroupFieldEditor bugzillaVersionEditor; // private static final String bugzilla220Label = "Using Bugzilla 2.20 compatiblity (overrides option below, some features disabled)"; - private static final String bugzilla218Label = "Using Bugzilla 2.18 or later (default is 2.16)"; - +// private static final String bugzilla218Label = "Using Bugzilla 2.16 (default is 2.16)"; +// private BooleanFieldEditor bugzilla220; +// private BooleanFieldEditor bugzilla218; + private static final String bugzillaMaxResultsLabel = "Maximum returned results: "; - - private BooleanFieldEditor bugzilla220; - private BooleanFieldEditor bugzilla218; - private StringFieldEditor bugzillaUser; - private MyStringFieldEditor bugzillaPassword; - private IntegerFieldEditor maxResults; - private BooleanFieldEditor refreshQueries; - + /** * Constructor for the preferences page */ - public BugzillaPreferences() { + public BugzillaPreferencePage() { super(GRID); // set the preference store for this preference page @@ -99,6 +98,19 @@ public class BugzillaPreferences @Override public void createControl(Composite parent) { super.createControl(parent); +// server220.setSelection(getPreferenceStore().getBoolean(MylarTasklistPlugin.REPORT_OPEN_EDITOR)); + + // HACK: there has to be an easier way + Control[] radios = bugzillaVersionEditor.getRadioBoxControl(getFieldEditorParent()).getChildren(); + String currentVersion = BugzillaPlugin.getDefault().getPreferenceStore().getString(IBugzillaConstants.SERVER_VERSION); + for (int i = 0; i < radios.length; i++) { + Button button = (Button)radios[i]; + if (button.getText().equals(currentVersion)) { + button.setSelection(true); + } else { + button.setSelection(false); + } + } } @Override @@ -126,8 +138,18 @@ public class BugzillaPreferences maxResults = new IntegerFieldEditor(IBugzillaConstants.MAX_RESULTS, bugzillaMaxResultsLabel, getFieldEditorParent()); -// bugzilla220 = new BooleanFieldEditor(IBugzillaConstants.IS_220, bugzilla220Label, BooleanFieldEditor.DEFAULT, getFieldEditorParent()); - bugzilla218 = new BooleanFieldEditor(IBugzillaConstants.IS_218, bugzilla218Label, BooleanFieldEditor.DEFAULT, getFieldEditorParent()); +// bugzillaVersionEditor.setPreferenceStore(BugzillaPlugin.getDefault().getPreferenceStore()); + bugzillaVersionEditor = new RadioGroupFieldEditor( + IBugzillaConstants.BUGZILLA_SERVER, "Bugzilla Version", 3, + new String[][] { + {IBugzillaConstants.SERVER_220, IBugzillaConstants.BUGZILLA_SERVER}, + {IBugzillaConstants.SERVER_218, IBugzillaConstants.BUGZILLA_SERVER}, + {IBugzillaConstants.SERVER_216, IBugzillaConstants.BUGZILLA_SERVER} + }, + getFieldEditorParent()); + +// bugzillaVersionEditor.setPropertyChangeListener(new IPropertyChangeListener() {) +// bugzilla218 = new BooleanFieldEditor(IBugzillaConstants.IS_218, bugzilla218Label, BooleanFieldEditor.DEFAULT, getFieldEditorParent()); refreshQueries = new BooleanFieldEditor(IBugzillaConstants.REFRESH_QUERY, "Automatically refresh Bugzilla reports and queries on startup", BooleanFieldEditor.DEFAULT, getFieldEditorParent()); @@ -137,8 +159,8 @@ public class BugzillaPreferences addField(bugzillaUser); addField(bugzillaPassword); addField(maxResults); - addField(bugzilla220); - addField(bugzilla218); + addField(bugzillaVersionEditor); +// addField(bugzilla218); addField(refreshQueries); @@ -158,9 +180,12 @@ public class BugzillaPreferences // most recent query getCachedData(); - store.setDefault(IBugzillaConstants.BUGZILLA_SERVER,IBugzillaConstants.DEFAULT_BUGZILLA_SERVER); + store.setDefault(IBugzillaConstants.BUGZILLA_SERVER, IBugzillaConstants.DEFAULT_BUGZILLA_SERVER); store.setDefault(IBugzillaConstants.MOST_RECENT_QUERY, ""); - store.setDefault(IBugzillaConstants.IS_218, true); + + store.setDefault(IBugzillaConstants.SERVER_VERSION, IBugzillaConstants.SERVER_220); +// store.setDefault(IBugzillaConstants.IS_218, true); + store.setDefault(IBugzillaConstants.REFRESH_QUERY, false); store.setDefault(IBugzillaConstants.MAX_RESULTS, 100); @@ -183,8 +208,18 @@ public class BugzillaPreferences @Override public boolean performOk() { - BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.IS_218, bugzilla218.getBooleanValue()); - BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.REFRESH_QUERY, refreshQueries.getBooleanValue()); + // HACK: there has to be an easier way + Control[] radios = bugzillaVersionEditor.getRadioBoxControl(getFieldEditorParent()).getChildren(); + for (int i = 0; i < radios.length; i++) { + Button button = (Button)radios[i]; + if (button.getSelection()) { + BugzillaPlugin.getDefault().getPreferenceStore().setValue( + IBugzillaConstants.SERVER_VERSION, + button.getText()); + } + } + + BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.REFRESH_QUERY, refreshQueries.getBooleanValue()); BugzillaPlugin.getDefault().getPreferenceStore().setValue(IBugzillaConstants.MAX_RESULTS, maxResults.getIntValue()); String oldBugzillaServer = BugzillaPlugin.getDefault().getServerName(); ProductConfiguration configuration = null; @@ -530,14 +565,6 @@ public class BugzillaPreferences getCachedData(); return user; } - - /** - * Get whether we are dealing with Bugzilla 2.18 or not - * @return true if it is 218 - */ - public static boolean is218(){ - return BugzillaPlugin.getDefault().getPreferenceStore().getBoolean(IBugzillaConstants.IS_218); - } /** * Gets the bugzilla password from the preferences @@ -600,7 +627,7 @@ public class BugzillaPreferences try { temp = new URL("http://" + IBugzillaConstants.PLUGIN_ID); } catch (MalformedURLException e) { - BugzillaPlugin.log(new Status(IStatus.WARNING, IBugzillaConstants.PLUGIN_ID,IStatus.OK,"Bad temp server url: BugzillaPreferences", e)); + BugzillaPlugin.log(new Status(IStatus.WARNING, IBugzillaConstants.PLUGIN_ID,IStatus.OK,"Bad temp server url: BugzillaPreferencePage", e)); } FAKE_URL = temp; } diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRepository.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRepository.java index 3e68d653b..ebe9877a0 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRepository.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/BugzillaRepository.java @@ -121,7 +121,7 @@ public class BugzillaRepository // allow the use to only see the operations that they can do to a bug if they have // their user name and password in the preferences - if(BugzillaPreferences.getUserName() != null && !BugzillaPreferences.getUserName().equals("") && BugzillaPreferences.getPassword() != null && !BugzillaPreferences.getPassword().equals("")) + if(BugzillaPreferencePage.getUserName() != null && !BugzillaPreferencePage.getUserName().equals("") && BugzillaPreferencePage.getPassword() != null && !BugzillaPreferencePage.getPassword().equals("")) { /* * The UnsupportedEncodingException exception for @@ -129,7 +129,7 @@ public class BugzillaRepository * implementation of the Java platform is required to support * the standard charset "UTF-8" */ - url += "&GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8"); + url += "&GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferencePage.getPassword(), "UTF-8"); } URL bugUrl = new URL(url); @@ -140,7 +140,7 @@ public class BugzillaRepository in = new BufferedReader(new InputStreamReader(input)); // get the actual bug fron the server and return it - BugReport bug = BugParser.parseBug(in, id, BugzillaPlugin.getDefault().getServerName(), BugzillaPreferences.is218(), BugzillaPreferences.getUserName(), BugzillaPreferences.getPassword()); + BugReport bug = BugParser.parseBug(in, id, BugzillaPlugin.getDefault().getServerName(), BugzillaPlugin.getDefault().isServerCompatability218(), BugzillaPreferencePage.getUserName(), BugzillaPreferencePage.getPassword()); return bug; } } @@ -212,7 +212,7 @@ public class BugzillaRepository String urlText = ""; // use the usename and password to get into bugzilla if we have it - if(BugzillaPreferences.getUserName() != null && !BugzillaPreferences.getUserName().equals("") && BugzillaPreferences.getPassword() != null && !BugzillaPreferences.getPassword().equals("")) + if(BugzillaPreferencePage.getUserName() != null && !BugzillaPreferencePage.getUserName().equals("") && BugzillaPreferencePage.getPassword() != null && !BugzillaPreferencePage.getPassword().equals("")) { /* * The UnsupportedEncodingException exception for @@ -220,7 +220,7 @@ public class BugzillaRepository * implementation of the Java platform is required to support * the standard charset "UTF-8" */ - urlText += "?GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8"); + urlText += "?GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferencePage.getPassword(), "UTF-8"); } URL url = new URL(bugzillaUrl + "/enter_bug.cgi"+urlText); @@ -278,7 +278,7 @@ public class BugzillaRepository * implementation of the Java platform is required to support * the standard charset "UTF-8" */ - url += "&GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8"); + url += "&GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferencePage.getPassword(), "UTF-8"); URL bugUrl = new URL(url); URLConnection cntx = BugzillaPlugin.getDefault().getUrlConnection(bugUrl); @@ -398,15 +398,15 @@ public class BugzillaRepository public static String getBugUrl(int id) { String url = BugzillaPlugin.getDefault().getServerName() + "/show_bug.cgi?id=" + id; try { - if (BugzillaPreferences.getUserName() != null - && !BugzillaPreferences.getUserName().equals("") - && BugzillaPreferences.getPassword() != null - && !BugzillaPreferences.getPassword().equals("")) { + if (BugzillaPreferencePage.getUserName() != null + && !BugzillaPreferencePage.getUserName().equals("") + && BugzillaPreferencePage.getPassword() != null + && !BugzillaPreferencePage.getPassword().equals("")) { url += "&GoAheadAndLogIn=1&Bugzilla_login=" - + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" - + URLEncoder.encode(BugzillaPreferences.getPassword(),"UTF-8"); + + URLEncoder.encode(BugzillaPreferencePage.getPassword(),"UTF-8"); } } catch (UnsupportedEncodingException e) { return ""; diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/IBugzillaConstants.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/IBugzillaConstants.java index 849f3e656..af4db68ff 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/IBugzillaConstants.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/IBugzillaConstants.java @@ -52,8 +52,16 @@ public interface IBugzillaConstants // Bugzilla Preferences keys static final String BUGZILLA_SERVER = "BUGZILLA_SERVER"; static final String MOST_RECENT_QUERY = "MOST_RECENT_QUERY"; - static final String IS_218 = "BUGZILLA_IS_218"; - static final String IS_220 = "BUGZILLA_IS_220"; + + static final String SERVER_VERSION = "org.eclipse.mylar.bugzilla.server.version"; + static final String SERVER_220 = "2.20"; + static final String SERVER_218 = "2.18"; + static final String SERVER_216 = "2.16"; + +// static final String IS_216 = "BUGZILLA_IS_216"; +// static final String IS_218 = "BUGZILLA_IS_218"; +// static final String IS_220 = "BUGZILLA_IS_220"; + static final String REFRESH_QUERY = "REFRESH_QUERY"; static final String MAX_RESULTS = "MAX_BUGZILLA_RESULTS"; diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/offline/OfflineReportsFile.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/offline/OfflineReportsFile.java index 0b5d94c74..40ed4959b 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/offline/OfflineReportsFile.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/offline/OfflineReportsFile.java @@ -24,6 +24,8 @@ import org.eclipse.compare.CompareConfiguration; import org.eclipse.compare.structuremergeviewer.DiffNode; import org.eclipse.compare.structuremergeviewer.Differencer; import org.eclipse.compare.structuremergeviewer.IDiffElement; +import org.eclipse.core.runtime.CoreException; +import org.eclipse.core.runtime.IStatus; import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.mylar.bugzilla.core.BugReport; @@ -83,7 +85,7 @@ public class OfflineReportsFile * Add an offline report to the offline reports list * @param entry The bug to add */ - public boolean add(IBugzillaBug entry, boolean saveChosen) { + public boolean add(IBugzillaBug entry, boolean saveChosen) throws CoreException { try{ BugzillaOfflineStaus status = BugzillaOfflineStaus.SAVED; // check for bug and do a compare @@ -161,9 +163,14 @@ public class OfflineReportsFile BugzillaPlugin.getDefault().fireOfflineStatusChanged(entry, status); return true; } catch (Exception e) { - MessageDialog.openError(null, "failed to add of offline reort", e.getMessage()); + IStatus status = new Status( + IStatus.ERROR, + IBugzillaConstants.PLUGIN_ID, + IStatus.OK, + "failed to add of offline reort", + e); + throw new CoreException(status); } - return false; } /** @@ -379,7 +386,7 @@ public class OfflineReportsFile * @param bug * The bug to add/update. */ - public static void saveOffline(IBugzillaBug bug, boolean saveChosen) { + public static void saveOffline(IBugzillaBug bug, boolean saveChosen) throws CoreException { OfflineReportsFile file = BugzillaPlugin.getDefault().getOfflineReports(); // If there is already an offline report for this bug, update the file. if (bug.isSavedOffline()) { diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaQueryPageParser.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaQueryPageParser.java index b788acaf5..6de66adca 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaQueryPageParser.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaQueryPageParser.java @@ -31,7 +31,7 @@ import org.eclipse.core.runtime.Status; import org.eclipse.jface.dialogs.ErrorDialog; import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; import org.eclipse.mylar.bugzilla.core.internal.HtmlStreamTokenizer; import org.eclipse.mylar.bugzilla.core.internal.HtmlTag; @@ -90,22 +90,22 @@ public class BugzillaQueryPageParser // if we are dealing with 2.18 we need to use the folowing in the // query string to get the right search page - if(BugzillaPreferences.is218()){ + if(BugzillaPlugin.getDefault().isServerCompatability218()){ urlString += "?format=advanced"; } // use the user name and password if we have it - if(BugzillaPreferences.getUserName() != null && !BugzillaPreferences.getUserName().equals("") && BugzillaPreferences.getPassword() != null && !BugzillaPreferences.getPassword().equals("")) + if(BugzillaPreferencePage.getUserName() != null && !BugzillaPreferencePage.getUserName().equals("") && BugzillaPreferencePage.getPassword() != null && !BugzillaPreferencePage.getPassword().equals("")) { try { // if we are dealing with 2.18 we already have the ? from before so we need // an & instead. If other version, still add ? - if(BugzillaPreferences.is218()) + if(BugzillaPlugin.getDefault().isServerCompatability218()) urlString+="&"; else urlString+="?"; - urlString += "GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8"); + urlString += "GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferencePage.getPassword(), "UTF-8"); } catch (UnsupportedEncodingException e) { /* diff --git a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java index 96bb08c9a..666a867b5 100644 --- a/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java +++ b/org.eclipse.mylyn.bugzilla.core/src/org/eclipse/mylyn/bugzilla/core/search/BugzillaSearchEngine.java @@ -29,7 +29,7 @@ import org.eclipse.core.runtime.OperationCanceledException; import org.eclipse.core.runtime.Status; import org.eclipse.mylar.bugzilla.core.BugzillaException; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; import org.eclipse.search.ui.NewSearchUI; @@ -49,7 +49,9 @@ public class BugzillaSearchEngine { protected static final RegularExpression re = new RegularExpression("<a href=\"show_bug.cgi\\?id=(\\d+)\">", "i"); /** regular expression matching values of query matches' attributes in Eclipse.org Bugzilla */ - protected static final RegularExpression reValue = new RegularExpression("<td><nobr>([^<]*)</nobr>"); + public static final RegularExpression reValue = new RegularExpression("<td><nobr>([^<]*)</nobr>"); + + public static final RegularExpression reValueBugzilla220 = new RegularExpression("<td style=\"white-space: nowrap\">([^<]*)"); /** regular expression matching Bugzilla query results format used in v2.12 */ protected static final RegularExpression reOld = new RegularExpression("<a href=\"show_bug.cgi\\?id=(\\d+)\">\\d+</a>\\s*<td class=severity><nobr>([^>]+)</nobr><td class=priority><nobr>([^>]+)</nobr><td class=platform><nobr>([^>]*)</nobr><td class=owner><nobr>([^>]*)</nobr><td class=status><nobr>([^>]*)</nobr><td class=resolution><nobr>([^>]*)</nobr><td class=summary>(.*)$", "i"); @@ -62,10 +64,10 @@ public class BugzillaSearchEngine { this.urlString = url; // use the username and password if we have it to log into bugzilla - if(BugzillaPreferences.getUserName() != null && !BugzillaPreferences.getUserName().equals("") && BugzillaPreferences.getPassword() != null && !BugzillaPreferences.getPassword().equals("")) + if(BugzillaPreferencePage.getUserName() != null && !BugzillaPreferencePage.getUserName().equals("") && BugzillaPreferencePage.getPassword() != null && !BugzillaPreferencePage.getPassword().equals("")) { try { - url += "&GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8"); + url += "&GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferencePage.getPassword(), "UTF-8"); } catch (UnsupportedEncodingException e) { /* * Do nothing. Every implementation of the Java platform is required @@ -134,12 +136,9 @@ public class BugzillaSearchEngine { */ public IStatus search(IBugzillaSearchResultCollector collector, int startMatches, int maxMatches) throws LoginException { IProgressMonitor monitor = collector.getProgressMonitor(); - IStatus status = null; - boolean possibleBadLogin = false; int numCollected = 0; - BufferedReader in = null; try { @@ -147,17 +146,14 @@ public class BugzillaSearchEngine { collector.aboutToStart(startMatches); URLConnection cntx = BugzillaPlugin.getDefault().getUrlConnection(new URL(urlString)); - if(cntx == null || !(cntx instanceof HttpURLConnection)) + if(cntx == null || !(cntx instanceof HttpURLConnection)) { return null; + } HttpURLConnection connect = (HttpURLConnection) cntx; - connect.connect(); - int responseCode = connect.getResponseCode(); - - if(responseCode != HttpURLConnection.HTTP_OK) - { + if(responseCode != HttpURLConnection.HTTP_OK) { String msg; if(responseCode == -1 || responseCode == HttpURLConnection.HTTP_FORBIDDEN) msg = BugzillaPlugin.getDefault().getServerName() + " does not seem to be a valid Bugzilla server. Check Bugzilla preferences."; @@ -172,7 +168,6 @@ public class BugzillaSearchEngine { } in = new BufferedReader(new InputStreamReader(connect.getInputStream())); - if (monitor.isCanceled()) { throw new OperationCanceledException("Search cancelled"); } @@ -180,8 +175,7 @@ public class BugzillaSearchEngine { Match match = new Match(); String line; while ((line = in.readLine()) != null) { - - if(maxMatches != -1 && numCollected >= maxMatches){ + if(maxMatches != -1 && numCollected >= maxMatches) { maxReached = true; break; } @@ -222,60 +216,19 @@ public class BugzillaSearchEngine { BugzillaSearchHit hit = new BugzillaSearchHit(id, description, severity, priority, platform, state, result, owner, query, server); collector.accept(hit); numCollected++; + } else if (re.matches(line, match)) { - int id = Integer.parseInt(match.getCapturedText(1)); - String severity = null; - String priority = null; - String platform = null; - String owner = null; - String state = null; - String result = null; - for (int i = 0; i < 6; i++) { - if (monitor.isCanceled()) { - throw new OperationCanceledException("Search cancelled"); - } - do { - if (monitor.isCanceled()) { - throw new OperationCanceledException("Search cancelled"); - } - line = in.readLine(); - if (line == null) break; - line = line.trim(); - } while (!reValue.matches(line, match)); - switch (i) { - case 0: - severity = match.getCapturedText(1); - break; - case 1: - priority = match.getCapturedText(1); - break; - case 2: - platform = match.getCapturedText(1); - break; - case 3: - owner = match.getCapturedText(1); - break; - case 4: - state = match.getCapturedText(1); - break; - case 5: - result = match.getCapturedText(1); - break; - } + RegularExpression regularExpression; + if (BugzillaPlugin.getDefault().isServerCompatability220()) { + System.err.println("220"); + regularExpression = reValueBugzilla220; + } else { + System.err.println("218"); + regularExpression = reValue; } - // two more - line = in.readLine(); - line = in.readLine(); - - String description = "<activate to view description>"; - if (line != null) description = line.substring(8); - String query = BugzillaPlugin.getMostRecentQuery(); - if (query == null) query = ""; - - String server = BugzillaPlugin.getDefault().getServerName(); - - BugzillaSearchHit hit = new BugzillaSearchHit(id, description, severity, priority, platform, state, result, owner, query, server); + int id = Integer.parseInt(match.getCapturedText(1)); + BugzillaSearchHit hit = createHit(regularExpression, monitor, in, match, id); collector.accept(hit); numCollected++; } @@ -290,11 +243,10 @@ public class BugzillaSearchEngine { // write error to log BugzillaPlugin.log(status); - } - catch (OperationCanceledException e) { + } catch (OperationCanceledException e) { status = new Status(IStatus.CANCEL, IBugzillaConstants.PLUGIN_ID, IStatus.CANCEL, "", null); - }catch (Exception e) { + } catch (Exception e) { status = new MultiStatus( IBugzillaConstants.PLUGIN_ID, IStatus.ERROR, e.getClass().toString() + " occurred while querying Bugzilla Server " + BugzillaPlugin.getDefault().getServerName() + ".\n" + "\nClick Details or see log for more information.", e); @@ -332,6 +284,66 @@ public class BugzillaSearchEngine { return status; } + public static BugzillaSearchHit createHit(RegularExpression regularExpression, IProgressMonitor monitor, BufferedReader in, Match match, int id) throws IOException { + String line; + String severity = null; + String priority = null; + String platform = null; + String owner = null; + String state = null; + String result = null; + for (int i = 0; i < 6; i++) { + do { + if (monitor.isCanceled()) { + throw new OperationCanceledException("Search cancelled"); + } + line = in.readLine(); + if (line == null) break; + line = line.trim(); + } while (!regularExpression.matches(line, match)); + switch (i) { + case 0: + severity = match.getCapturedText(1); + break; + case 1: + priority = match.getCapturedText(1); + break; + case 2: + platform = match.getCapturedText(1); + break; + case 3: + owner = match.getCapturedText(1); + break; + case 4: + state = match.getCapturedText(1); + break; + case 5: + result = match.getCapturedText(1); + break; + } + } + + // two more + line = in.readLine(); + line = in.readLine(); + + String description = "<activate to view description>"; + if (line != null) description = line.substring(8); + + String query = ""; + String server = "<unknown server>"; + try { + String recentQuery = BugzillaPlugin.getMostRecentQuery(); + if (recentQuery != null) query = recentQuery; + server = BugzillaPlugin.getDefault().getServerName(); + } catch (Exception e) { + // ignore, for testing + } + + BugzillaSearchHit hit = new BugzillaSearchHit(id, description, severity, priority, platform, state, result, owner, query, server); + return hit; + } + public boolean isMaxReached() { return maxReached; } diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java index 8169cb2a4..76a459fb5 100644 --- a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/AllBugzillaTests.java @@ -21,13 +21,14 @@ public class AllBugzillaTests { public static Test suite() { TestSuite suite = new TestSuite("Test for org.eclipse.mylar.bugzilla.test"); //$JUnit-BEGIN$ - suite.addTest(new TestSuite(BugzillaNewBugParserTestCDT.class)); - suite.addTest(new TestSuite(BugzillaNewBugParserTestEquinox.class)); - suite.addTest(new TestSuite(BugzillaNewBugParserTestGMT.class)); - suite.addTest(new TestSuite(BugzillaNewBugParserTestPlatform.class)); - suite.addTest(new TestSuite(BugzillaNewBugParserTestVE.class)); - suite.addTest(new TestSuite(BugzillaParserTestNoBug.class)); - suite.addTest(new TestSuite(BugzillaProductParserTest.class)); + suite.addTestSuite(RegularExpressionMatchTest.class); + suite.addTestSuite(BugzillaNewBugParserTestCDT.class); + suite.addTestSuite(BugzillaNewBugParserTestEquinox.class); + suite.addTestSuite(BugzillaNewBugParserTestGMT.class); + suite.addTestSuite(BugzillaNewBugParserTestPlatform.class); + suite.addTestSuite(BugzillaNewBugParserTestVE.class); + suite.addTestSuite(BugzillaParserTestNoBug.class); + suite.addTestSuite(BugzillaProductParserTest.class); // TODO: enable // suite.addTest(new TestSuite(BugzillaParserTest.class)); diff --git a/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java new file mode 100644 index 000000000..2da4d14c1 --- /dev/null +++ b/org.eclipse.mylyn.bugzilla.tests/src/org/eclipse/mylyn/bugzilla/test/RegularExpressionMatchTest.java @@ -0,0 +1,96 @@ +/******************************************************************************* + * Copyright (c) 2004 - 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.test; + +import java.io.BufferedReader; +import java.io.IOException; +import java.io.StringReader; + +import junit.framework.TestCase; + +import org.eclipse.core.runtime.NullProgressMonitor; +import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchEngine; +import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchHit; + +import com.sun.org.apache.xerces.internal.impl.xpath.regex.Match; + +public class RegularExpressionMatchTest extends TestCase { + + public void testMatchV218() throws IOException { + BufferedReader in = new BufferedReader(new StringReader(BUGZILLA_218)); + Match match = new Match(); + BugzillaSearchHit hit = BugzillaSearchEngine.createHit(BugzillaSearchEngine.reValue, new NullProgressMonitor(), in, match, 123); + assertEquals("nor", hit.getSeverity()); + assertEquals("P2", hit.getPriority()); + } + + public void testMatchV220() throws IOException { + BufferedReader in = new BufferedReader(new StringReader(BUGZILLA_220)); + Match match = new Match(); + BugzillaSearchHit hit = BugzillaSearchEngine.createHit(BugzillaSearchEngine.reValueBugzilla220, new NullProgressMonitor(), in, match, 123); + assertEquals("nor", hit.getSeverity()); + assertEquals("P2", hit.getPriority()); + System.err.println(">> " + hit.getSeverity()); + } + + private static final String BUGZILLA_218 = + " <tr class=\"bz_normal bz_P2 bz_ASSIGNED bz_even \">\n" + + " \n" + + "\n" + + " <td class=\"first-child\">\n" + + " <a href=\"show_bug.cgi?id=111870\">111870</a>\n" + + " <span style=\"display: none\"></span>\n" + + " </td>\n" + + "\n" + + " <td><nobr>nor</nobr>\n" + + " </td>\n" + + " <td><nobr>P2</nobr>\n" + + " </td>\n" + + " <td><nobr>Oth</nobr>\n" + + " </td>\n" + + " <td><nobr>wes.coelho@gmail.com</nobr>\n" + + " </td>\n" + + " <td><nobr>ASSI</nobr>\n" + + " </td>\n" + + " <td><nobr></nobr>\n" + + " </td>\n" + + " <td>hour estimates are wrong\n" + + " </td>\n" + + "\n" + + " </tr>\n"; + + private static final String BUGZILLA_220 = + " <tr class=\"bz_enhancement bz_P2 bz_ASSIGNED bz_row_odd \">\n" + + " \n" + + "\n" + + " <td class=\"first-child\">\n" + + " <a href=\"show_bug.cgi?id=114172\">114172</a>\n" + + " <span style=\"display: none\"></span>\n" + + " </td>\n" + + "\n" + + " <td style=\"white-space: nowrap\">nor\n" + + " </td>\n" + + " <td style=\"white-space: nowrap\">P2\n" + + " </td>\n" + + " <td style=\"white-space: nowrap\">PC\n" + + " </td>\n" + + " <td style=\"white-space: nowrap\">wes.coelho@gmail.com\n" + + " </td>\n" + + " <td style=\"white-space: nowrap\">ASSI\n" + + " </td>\n" + + " <td style=\"white-space: nowrap\">\n" + + " </td>\n" + + " <td >Switch task data directory option on the task list\n" + + " </td>\n" + + "\n" + + " </tr>\n"; +} 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 dd586a9f0..9a95b0376 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 @@ -14,6 +14,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; +import org.eclipse.core.runtime.CoreException; import org.eclipse.jface.action.GroupMarker; import org.eclipse.jface.action.IMenuListener; import org.eclipse.jface.action.IMenuManager; @@ -41,6 +42,7 @@ 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.mylar.core.MylarPlugin; import org.eclipse.swt.SWT; import org.eclipse.swt.events.KeyAdapter; import org.eclipse.swt.events.KeyEvent; @@ -476,7 +478,7 @@ public class OfflineView extends ViewPart { */ public static void saveOffline(final IBugzillaBug bug, final boolean saveChosen) { Display.getDefault().asyncExec(new Runnable(){ - public void run() { + public void run() { OfflineReportsFile file = BugzillaPlugin.getDefault().getOfflineReports(); // If there is already an offline report for this bug, update the file. @@ -492,8 +494,12 @@ public class OfflineView extends ViewPart { // MessageDialog.openInformation(null, "Bug's Id is already used.", "There is already a bug saved offline with an identical id."); // return; // } - file.add(bug, saveChosen); - bug.setOfflineState(true); + try { + file.add(bug, saveChosen); + bug.setOfflineState(true); + } catch (CoreException e) { + MylarPlugin.fail(e, e.getMessage(), false); + } // file.sort(OfflineReportsFile.lastSel); } // OfflineView.checkWindow(); 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 4f92e6189..38931b7ba 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 @@ -40,7 +40,7 @@ import org.eclipse.jface.viewers.StructuredSelection; 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.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.BugzillaRepository; import org.eclipse.mylar.bugzilla.core.BugzillaTools; import org.eclipse.mylar.bugzilla.core.Comment; @@ -450,10 +450,16 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener { infoArea.setLayout(infoLayout); infoArea.setBackground(background); if (getBug() == null) { - close(); - MessageDialog.openError(infoArea.getShell(), "No such bug", - "No bug exists with this id"); - return null; +// close(); + MessageDialog.openError( + Display.getDefault().getActiveShell(), + "Bugzilla Client Errror", + "Could not resolve the requested bug, check Bugzilla server and version."); + + Composite composite = new Composite(parent, SWT.NULL); + Label noBugLabel = new Label(composite, SWT.NULL); + noBugLabel.setText("Could not resolve bug"); + return composite; } createLayouts(); @@ -1374,8 +1380,8 @@ public abstract class AbstractBugEditor extends EditorPart implements Listener { } // add the login information to the bug post - form.add("Bugzilla_login", BugzillaPreferences.getUserName()); - form.add("Bugzilla_password", BugzillaPreferences.getPassword()); + form.add("Bugzilla_login", BugzillaPreferencePage.getUserName()); + form.add("Bugzilla_password", BugzillaPreferencePage.getPassword()); } @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 51e281d5b..051655d81 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 @@ -41,7 +41,7 @@ import org.eclipse.mylar.bugzilla.core.BugPost; import org.eclipse.mylar.bugzilla.core.BugReport; import org.eclipse.mylar.bugzilla.core.BugzillaException; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.BugzillaRepository; import org.eclipse.mylar.bugzilla.core.Comment; import org.eclipse.mylar.bugzilla.core.IBugzillaBug; @@ -973,14 +973,14 @@ public class ExistingBugEditor extends AbstractBugEditor Attribute owner = bug.getAttribute("Assigned To"); //Don't add the cc if the user is the bug owner - if(owner != null && owner.getValue().indexOf(BugzillaPreferences.getUserName()) > -1){ + if(owner != null && owner.getValue().indexOf(BugzillaPreferencePage.getUserName()) > -1){ return; } //Add the user to the cc list if(newCCattr != null) { if (newCCattr.getNewValue().equals("")){ - newCCattr.setNewValue(BugzillaPreferences.getUserName()); + newCCattr.setNewValue(BugzillaPreferencePage.getUserName()); } } } diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/search/BugzillaSearchPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/search/BugzillaSearchPage.java index f603434e9..096fd170d 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/search/BugzillaSearchPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/search/BugzillaSearchPage.java @@ -24,7 +24,7 @@ import org.eclipse.jface.dialogs.MessageDialog; import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchOperation; import org.eclipse.mylar.bugzilla.core.search.BugzillaSearchQuery; @@ -78,18 +78,18 @@ public class BugzillaSearchPage extends DialogPage implements ISearchPage { private static final String [] emailRoleValues = {"emailassigned_to1", "emailreporter1", "emailcc1", "emaillongdesc1"}; protected IPreferenceStore prefs = BugzillaPlugin.getDefault().getPreferenceStore(); - private String [] statusValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES)); - protected String [] preselectedStatusValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRESELECTED_STATUS_VALUES)); - private String [] resolutionValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES)); - private String [] severityValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.SEVERITY_VALUES)); - private String [] priorityValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRIORITY_VALUES)); - private String [] hardwareValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.HARDWARE_VALUES)); - private String [] osValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.OS_VALUES)); + private String [] statusValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES)); + protected String [] preselectedStatusValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRESELECTED_STATUS_VALUES)); + private String [] resolutionValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES)); + private String [] severityValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.SEVERITY_VALUES)); + private String [] priorityValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRIORITY_VALUES)); + private String [] hardwareValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.HARDWARE_VALUES)); + private String [] osValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.OS_VALUES)); - private String [] productValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRODUCT_VALUES)); - private String [] componentValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.COMPONENT_VALUES)); - private String [] versionValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.VERSION_VALUES)); - private String [] targetValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.TARGET_VALUES)); + private String [] productValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRODUCT_VALUES)); + private String [] componentValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.COMPONENT_VALUES)); + private String [] versionValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.VERSION_VALUES)); + private String [] targetValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.TARGET_VALUES)); private static class BugzillaSearchData { /** Pattern to match on */ @@ -624,29 +624,29 @@ public class BugzillaSearchPage extends DialogPage implements ISearchPage { monitor.beginTask("Updating search options...", 55); try { - BugzillaPreferences.updateQueryOptions(monitor); + BugzillaPreferencePage.updateQueryOptions(monitor); - product.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRODUCT_VALUES))); + product.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRODUCT_VALUES))); monitor.worked(1); - component.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.COMPONENT_VALUES))); + component.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.COMPONENT_VALUES))); monitor.worked(1); - version.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.VERSION_VALUES))); + version.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.VERSION_VALUES))); monitor.worked(1); - target.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.TARGET_VALUES))); + target.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.TARGET_VALUES))); monitor.worked(1); - status.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES))); + status.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES))); monitor.worked(1); - status.setSelection(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRESELECTED_STATUS_VALUES))); + status.setSelection(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRESELECTED_STATUS_VALUES))); monitor.worked(1); - resolution.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES))); + resolution.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES))); monitor.worked(1); - severity.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.SEVERITY_VALUES))); + severity.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.SEVERITY_VALUES))); monitor.worked(1); - priority.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRIORITY_VALUES))); + priority.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRIORITY_VALUES))); monitor.worked(1); - hardware.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.HARDWARE_VALUES))); + hardware.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.HARDWARE_VALUES))); monitor.worked(1); - os.setItems(BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.OS_VALUES))); + os.setItems(BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.OS_VALUES))); monitor.worked(1); } catch (LoginException exception) { @@ -851,10 +851,10 @@ public class BugzillaSearchPage extends DialogPage implements ISearchPage { sb.append("buglist.cgi?"); // use the username and password if we have it - if(BugzillaPreferences.getUserName() != null && !BugzillaPreferences.getUserName().equals("") && BugzillaPreferences.getPassword() != null && !BugzillaPreferences.getPassword().equals("")) + if(BugzillaPreferencePage.getUserName() != null && !BugzillaPreferencePage.getUserName().equals("") && BugzillaPreferencePage.getPassword() != null && !BugzillaPreferencePage.getPassword().equals("")) { try { - sb.append("GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferences.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferences.getPassword(), "UTF-8") + "&"); + sb.append("GoAheadAndLogIn=1&Bugzilla_login=" + URLEncoder.encode(BugzillaPreferencePage.getUserName(), "UTF-8") + "&Bugzilla_password=" + URLEncoder.encode(BugzillaPreferencePage.getPassword(), "UTF-8") + "&"); } catch (UnsupportedEncodingException e) { /* * Do nothing. Every implementation of the Java platform is required diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java index cd2cd3258..81e19a78b 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTask.java @@ -31,7 +31,6 @@ import org.eclipse.mylar.bugzilla.core.BugzillaRepository; import org.eclipse.mylar.bugzilla.core.IBugzillaBug; import org.eclipse.mylar.bugzilla.core.internal.HtmlStreamTokenizer; import org.eclipse.mylar.bugzilla.ui.BugzillaImages; -import org.eclipse.mylar.bugzilla.ui.BugzillaUITools; import org.eclipse.mylar.bugzilla.ui.BugzillaUiPlugin; import org.eclipse.mylar.bugzilla.ui.OfflineView; import org.eclipse.mylar.core.MylarPlugin; @@ -120,6 +119,7 @@ public class BugzillaTask extends Task { super(id, label, newTask); isDirty = false; scheduleDownloadReport(); + setUrl(); } public BugzillaTask(String id, String label, boolean noDownload, boolean newTask) { @@ -128,23 +128,23 @@ public class BugzillaTask extends Task { if (!noDownload) { scheduleDownloadReport(); } + setUrl(); } public BugzillaTask(BugzillaHit hit, boolean newTask) { this(hit.getHandle(), hit.getDescription(false), newTask); setPriority(hit.getPriority()); + setUrl(); } - /** - * Also sets the URL. - */ + private void setUrl() { + int id = BugzillaTask.getBugId(getHandle()); + String url = BugzillaRepository.getBugUrlWithoutLogin(id); + if (url != null) super.setIssueReportURL(url); + } + @Override public String getDescription(boolean isLabel) { - if (bugReport != null) { - String url = BugzillaRepository.getBugUrlWithoutLogin(bugReport.getId()); - if (url != null) super.setIssueReportURL(url); - } - if (this.isBugDownloaded() || !super.getDescription(isLabel).startsWith("<")) { return super.getDescription(isLabel); } else { @@ -320,11 +320,9 @@ public class BugzillaTask extends Task { Workbench.getInstance().getDisplay().asyncExec(new Runnable() { public void run() { - - MylarTasklistPlugin.ReportOpenMode mode = MylarTasklistPlugin.getDefault().getReportMode(); - if (mode == MylarTasklistPlugin.ReportOpenMode.EDITOR) { - - try{ + try{ + MylarTasklistPlugin.ReportOpenMode mode = MylarTasklistPlugin.getDefault().getReportMode(); + if (mode == MylarTasklistPlugin.ReportOpenMode.EDITOR) { // if we can reach the server, get the latest for the bug if(!isBugDownloaded() && offline){ MessageDialog.openInformation(null, "Unable to open bug", "Unable to open the selected bugzilla task since you are currently offline"); @@ -335,45 +333,38 @@ public class BugzillaTask extends Task { } else if(syncState == BugReportSyncState.OUTGOING || syncState == BugReportSyncState.CONFLICT){ input.setOfflineBug(bugReport); } - - // get the active workbench page - IWorkbenchPage page = MylarTasklistPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(); - - // if we couldn't get the page, get out of here - if (page == null) - return; - - // try to open an editor on the input bug - //page.openEditor(input, IBugzillaConstants.EXISTING_BUG_EDITOR_ID); - page.openEditor(input, "org.eclipse.mylar.bugzilla.ui.tasklist.bugzillaTaskEditor"); - } - catch (Exception ex) { - MylarPlugin.log(ex, "couldn't open bugzilla task"); - return; + // get the active workbench page + IWorkbenchPage page = MylarTasklistPlugin.getDefault().getWorkbench().getActiveWorkbenchWindow().getActivePage(); + if (page == null) return; + page.openEditor(input, "org.eclipse.mylar.bugzilla.ui.tasklist.bugzillaTaskEditor"); + + // else if (mode == MylarTasklistPlugin.ReportOpenMode.INTERNAL_BROWSER) { + // String title = "Bug #" + BugzillaTask.getBugId(getHandle()); + // BugzillaUITools.openUrl(title, title, getBugUrl()); + // } + if(syncState == BugReportSyncState.INCOMMING){ + syncState = BugReportSyncState.OK; + Display.getDefault().asyncExec(new Runnable(){ + public void run() { + if(TaskListView.getDefault() != null && TaskListView.getDefault().getViewer() != null && !TaskListView.getDefault().getViewer().getControl().isDisposed()){ + TaskListView.getDefault().getViewer().refresh(); + } + } + }); + } else if(syncState == BugReportSyncState.CONFLICT){ + syncState = BugReportSyncState.OUTGOING; + Display.getDefault().asyncExec(new Runnable(){ + public void run() { + if(TaskListView.getDefault() != null && TaskListView.getDefault().getViewer() != null && !TaskListView.getDefault().getViewer().getControl().isDisposed()){ + TaskListView.getDefault().getViewer().refresh(); + } + } + }); } - } else if (mode == MylarTasklistPlugin.ReportOpenMode.INTERNAL_BROWSER) { - String title = "Bug #" + BugzillaTask.getBugId(getHandle()); - BugzillaUITools.openUrl(title, title, getBugUrl()); - } - if(syncState == BugReportSyncState.INCOMMING){ - syncState = BugReportSyncState.OK; - Display.getDefault().asyncExec(new Runnable(){ - public void run() { - if(TaskListView.getDefault() != null && TaskListView.getDefault().getViewer() != null && !TaskListView.getDefault().getViewer().getControl().isDisposed()){ - TaskListView.getDefault().getViewer().refresh(); - } - } - }); - } else if(syncState == BugReportSyncState.CONFLICT){ - syncState = BugReportSyncState.OUTGOING; - Display.getDefault().asyncExec(new Runnable(){ - public void run() { - if(TaskListView.getDefault() != null && TaskListView.getDefault().getViewer() != null && !TaskListView.getDefault().getViewer().getControl().isDisposed()){ - TaskListView.getDefault().getViewer().refresh(); - } - } - }); + } catch (Exception ex) { + MylarPlugin.log(ex, "couldn't open bugzilla task"); + return; } } }); @@ -403,7 +394,8 @@ public class BugzillaTask extends Task { notifyTaskDataChange(); // Update time this bugtask was last downloaded. lastRefresh = new Date(); - bugReport = downloadReport(); + bugReport = downloadReport(); + state = BugTaskState.FREE; updateTaskDetails(); notifyTaskDataChange(); diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditor.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditor.java index 6febf4a4c..adf258e0d 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditor.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/tasklist/BugzillaTaskEditor.java @@ -39,7 +39,7 @@ import org.eclipse.ui.views.contentoutline.IContentOutlinePage; */ public class BugzillaTaskEditor extends TaskEditor { - private static final String EDITOR_TAB_ITLE = "Bugzilla Report"; + private static final String EDITOR_TAB_ITLE = "Bug Editor"; /** The task that created this editor */ protected BugzillaTask bugTask; @@ -63,7 +63,6 @@ public class BugzillaTaskEditor extends TaskEditor { } } }; - public BugzillaTaskEditor() { super(); 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 80120b30d..7ccc49660 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 @@ -25,7 +25,7 @@ import org.eclipse.mylar.bugzilla.core.Attribute; import org.eclipse.mylar.bugzilla.core.BugPost; import org.eclipse.mylar.bugzilla.core.BugzillaException; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; import org.eclipse.mylar.bugzilla.core.NewBugModel; import org.eclipse.mylar.bugzilla.core.PossibleBugzillaFailureException; @@ -95,7 +95,7 @@ public abstract class AbstractBugWizard extends Wizard implements INewWizard { public void addPages() { try { // check Bugzilla preferences to see if user has supplied a username - if (BugzillaPreferences.getUserName().equals("")) + if (BugzillaPreferencePage.getUserName().equals("")) throw new LoginException( "A Bugzilla User Name has not been provided." + " Please check your Bugzilla Preferences information."); @@ -346,8 +346,8 @@ public abstract class AbstractBugWizard extends Wizard implements INewWizard { form.setURL(baseURL + formName); // add the login information to the bug post - form.add("Bugzilla_login", BugzillaPreferences.getUserName()); - form.add("Bugzilla_password", BugzillaPreferences.getPassword()); + form.add("Bugzilla_login", BugzillaPreferencePage.getUserName()); + form.add("Bugzilla_password", BugzillaPreferencePage.getPassword()); } /** diff --git a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/WizardProductPage.java b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/WizardProductPage.java index 92b5ab4e8..aab523636 100644 --- a/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/WizardProductPage.java +++ b/org.eclipse.mylyn.bugzilla.ui/src/org/eclipse/mylyn/bugzilla/ui/wizard/WizardProductPage.java @@ -22,7 +22,7 @@ import org.eclipse.jface.dialogs.ProgressMonitorDialog; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.jface.wizard.IWizardPage; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.BugzillaRepository; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; import org.eclipse.mylar.bugzilla.core.NewBugModel; @@ -86,10 +86,10 @@ public class WizardProductPage extends AbstractWizardListPage { monitor.beginTask("Updating search options...", 55); try { - BugzillaPreferences.updateQueryOptions(monitor); + BugzillaPreferencePage.updateQueryOptions(monitor); products = new ArrayList<String>(); - for(String product : BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRODUCT_VALUES))){ + for(String product : BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.PRODUCT_VALUES))){ products.add(product); } monitor.worked(1); diff --git a/org.eclipse.mylyn.help.ui/doc/new.html b/org.eclipse.mylyn.help.ui/doc/new.html index 273c901b1..e6ce5a2e1 100644 --- a/org.eclipse.mylyn.help.ui/doc/new.html +++ b/org.eclipse.mylyn.help.ui/doc/new.html @@ -15,6 +15,23 @@ Submit feature requests to <a href="https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Mylar">Bugzilla</a>.</p> <h4><a href="new-0.4.0.html">New and Noteworthy covering Mylar 0.3.1 - 0.4.1</a></h4> +<table cellpadding="10" cellspacing="0" width="600" id="table78"> + <tr> + <td align="left" valign="top" width="30%"> + <p align="right"><b>Bugzilla 2.20 support</b></p> + </td> + <td valign="top" width="70%"> + <span style="background-color: #FFFF00">New editor tab makes it + quicker to flip into browser view, now default, chage pref</span><p> + </td> + </tr> + <tr> + <td colspan="2"> + <hr> + </td> + </tr> +</table> + <table cellpadding="10" cellspacing="0" width="600" id="table77"> <tr> <td align="left" valign="top" width="30%"> @@ -22,7 +39,7 @@ Submit feature requests to </td> <td valign="top" width="70%"> <span style="background-color: #FFFF00">New editor tab makes it - quicker to flip into browser view</span><p> + quicker to flip into browser view, now default, chage pref</span><p> </td> </tr> <tr> diff --git a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/Util.java b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/Util.java index 47d5821f8..84008772d 100644 --- a/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/Util.java +++ b/org.eclipse.mylyn.tasks.core/src/org/eclipse/mylyn/bugs/search/Util.java @@ -21,7 +21,7 @@ import org.eclipse.jdt.core.IMember; import org.eclipse.jdt.core.IType; import org.eclipse.jface.preference.IPreferenceStore; import org.eclipse.mylar.bugzilla.core.BugzillaPlugin; -import org.eclipse.mylar.bugzilla.core.BugzillaPreferences; +import org.eclipse.mylar.bugzilla.core.BugzillaPreferencePage; import org.eclipse.mylar.bugzilla.core.IBugzillaConstants; @@ -43,11 +43,11 @@ public class Util { /** * List of all of the resolutions that we can have <br> FIXED, INVALID, WONTFIX, LATER, REMIND, DUPLICATE, WORKSFORME, MOVED, --- */ - private static String[] resolutionValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES)); + private static String[] resolutionValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.RESOLUTION_VALUES)); /** * List of all of the statuses that we can have <br> UNCONFIRMED, NEW, ASSIGNED, REOPENED, RESOLVED, VERIFIED, CLOSED */ - private static String[] statusValues = BugzillaPreferences.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES)); + private static String[] statusValues = BugzillaPreferencePage.queryOptionsToArray(prefs.getString(IBugzillaConstants.STATUS_VALUES)); /** * Get the bugzilla url used for searching for exact matches @@ -145,15 +145,15 @@ public class Util { sb.append("buglist.cgi?"); // use the username and password if we have it - if (BugzillaPreferences.getUserName() != null - && !BugzillaPreferences.getUserName().equals("") - && BugzillaPreferences.getPassword() != null - && !BugzillaPreferences.getPassword().equals("")) { + if (BugzillaPreferencePage.getUserName() != null + && !BugzillaPreferencePage.getUserName().equals("") + && BugzillaPreferencePage.getPassword() != null + && !BugzillaPreferencePage.getPassword().equals("")) { try{ sb.append("GoAheadAndLogIn=1&Bugzilla_login=" - + URLEncoder.encode(BugzillaPreferences.getUserName(), Charset.defaultCharset().toString()) + + URLEncoder.encode(BugzillaPreferencePage.getUserName(), Charset.defaultCharset().toString()) + "&Bugzilla_password=" - + URLEncoder.encode(BugzillaPreferences.getPassword(), Charset.defaultCharset().toString()) + + URLEncoder.encode(BugzillaPreferencePage.getPassword(), Charset.defaultCharset().toString()) + "&"); } catch (UnsupportedEncodingException e) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java index dd69a3c9c..8f0d87494 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/MylarTasklistPlugin.java @@ -406,6 +406,7 @@ public class MylarTasklistPlugin extends AbstractUIPlugin implements IStartup { } public ReportOpenMode getReportMode() { +// return ReportOpenMode.EDITOR; if (getPrefs().getBoolean(REPORT_OPEN_EDITOR)) { return ReportOpenMode.EDITOR; } else if (getPrefs().getBoolean(REPORT_OPEN_INTERNAL)) { diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java index 9d42272f6..e7ebae779 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/TaskEditor.java @@ -40,7 +40,7 @@ import org.eclipse.ui.part.MultiPageSelectionProvider; public class TaskEditor extends MultiPageEditorPart { private static final String TASK_INFO_PAGE_LABEL = "Task Info"; - private static final String ISSUE_WEB_PAGE_LABEL = "Web Link"; + private static final String ISSUE_WEB_PAGE_LABEL = "Browser"; protected ITask task; private TaskSummaryEditor taskSummaryEditor; private Browser webBrowser; diff --git a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java index 7229c9bd3..343dab9f7 100644 --- a/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java +++ b/org.eclipse.mylyn.tasks.ui/src/org/eclipse/mylyn/tasklist/ui/views/ToolTipHandler.java @@ -50,10 +50,10 @@ public class ToolTipHandler { protected Point tipPosition; // the position being hovered over on the protected Point widgetPosition; // the position hovered over in the Widget; - private Shell parentShell; +// private Shell parentShell; public ToolTipHandler(Shell parent) { - this.parentShell = parent; +// this.parentShell = parent; final Display display = parent.getDisplay(); tipShell = new Shell(parent, SWT.NONE); GridLayout gridLayout = new GridLayout(); @@ -201,7 +201,7 @@ public class ToolTipHandler { tipShell.pack(); setHoverLocation(tipShell, tipPosition); tipShell.setVisible(true); - parentShell.setFocus(); +// parentShell.setFocus(); } }); // /* |