diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 00767e2c7b5c..7727a32e1a8c 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -569,9 +569,6 @@ jobs:
- name: ide/bugtracking.commons
run: ant $OPTS -f ide/bugtracking.commons test
-# - name: ide/bugzilla
-# run: ant $OPTS -f ide/bugzilla test
-
- name: ide/code.analysis
run: ant $OPTS -f ide/code.analysis test
diff --git a/ide/bugtracking.bridge/nbproject/project.xml b/ide/bugtracking.bridge/nbproject/project.xml
index e8a8ba6b49f4..7a45edae048b 100644
--- a/ide/bugtracking.bridge/nbproject/project.xml
+++ b/ide/bugtracking.bridge/nbproject/project.xml
@@ -172,10 +172,6 @@
unit
-
- org.eclipse.equinox.common
-
-
org.netbeans.libs.junit4
diff --git a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java
index ffc39aee6c84..84f1197a0b47 100644
--- a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java
+++ b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/bridge/nodes/BugtrackingRootNode.java
@@ -32,7 +32,9 @@
import org.netbeans.modules.bugtracking.api.Repository;
import org.netbeans.modules.bugtracking.api.RepositoryManager;
import org.netbeans.modules.bugtracking.api.Util;
+import org.netbeans.modules.bugtracking.spi.BugtrackingConnector;
import org.openide.nodes.*;
+import org.openide.util.Lookup;
import org.openide.util.NbBundle;
/**
@@ -85,10 +87,18 @@ public static BugtrackingRootNode getDefault() {
public Action[] getActions(boolean context) {
return new Action[] {
new AbstractAction(NbBundle.getMessage(BugtrackingRootNode.class, "LBL_CreateRepository")) { // NOI18N
+ final boolean hasConnector = Lookup.getDefault().lookup(BugtrackingConnector.class) != null;
+
@Override
public void actionPerformed(ActionEvent e) {
Util.createRepository();
}
+
+ @Override
+ public boolean isEnabled() {
+ return hasConnector;
+ }
+
}
};
}
diff --git a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java
index 7fb4bd18d8b6..5db33f19a3dd 100644
--- a/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java
+++ b/ide/bugtracking.bridge/src/org/netbeans/modules/bugtracking/vcs/HookPanel.java
@@ -31,8 +31,10 @@
import org.netbeans.modules.bugtracking.api.Issue;
import org.netbeans.modules.bugtracking.api.IssueQuickSearch;
import org.netbeans.modules.bugtracking.api.Repository;
+import org.netbeans.modules.bugtracking.spi.BugtrackingConnector;
import org.netbeans.modules.versioning.util.VerticallyNonResizingPanel;
import org.openide.filesystems.FileObject;
+import org.openide.util.Lookup;
/**
*
@@ -73,7 +75,7 @@ public HookPanel(FileObject context, boolean link, boolean resolve, boolean comm
qs = IssueQuickSearch.create(context);
qs.setChangeListener(this);
- qs.setEnabled(true);
+ qs.setEnabled(hasRegisteredConnectors());
issuePanel.add(qs.getComponent(), BorderLayout.NORTH);
linkCheckBox.setSelected(link);
@@ -239,4 +241,7 @@ public void stateChanged(ChangeEvent e) {
enableFields();
}
+ private boolean hasRegisteredConnectors() {
+ return Lookup.getDefault().lookup(BugtrackingConnector.class) != null;
+ }
}
diff --git a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java
index 57836bad5d20..aca97d8c94f9 100644
--- a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java
+++ b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/HgHookTest.java
@@ -24,20 +24,15 @@
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.util.Collection;
import java.util.Date;
import java.util.logging.Level;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
-import org.eclipse.core.runtime.CoreException;
import org.netbeans.junit.NbTestCase;
-import org.netbeans.modules.bugtracking.IssueImpl;
import org.netbeans.modules.bugtracking.TestKit;
-import org.netbeans.modules.bugtracking.api.IssueQuickSearch;
import org.netbeans.modules.bugtracking.api.Repository;
-import org.netbeans.modules.bugtracking.ui.search.QuickSearchComboBar;
import org.netbeans.modules.bugtracking.ui.search.QuickSearchPanel;
import org.netbeans.modules.bugtracking.vcs.VCSHooksConfig.HookType;
import org.netbeans.modules.bugtracking.vcs.VCSHooksConfig.PushOperation;
@@ -66,7 +61,7 @@ protected void setUp() throws Exception {
System.setProperty("netbeans.user", getWorkDir().getAbsolutePath() + "/userdir");
}
- public void testPanel() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testPanel() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HgHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.HG).setLink(true);
@@ -101,7 +96,7 @@ public void testPanel() throws MalformedURLException, CoreException, IOException
assertTrue(panel.pushRadioButton.isSelected());
}
- public void testBeforeCommitNoLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testBeforeCommitNoLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HgHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.HG).setLink(false);
@@ -114,7 +109,7 @@ public void testBeforeCommitNoLink() throws MalformedURLException, CoreException
assertNull(ctx);
}
- public void testBeforeCommitWithLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testBeforeCommitWithLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HgHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.HG).setLink(true);
@@ -130,7 +125,7 @@ public void testBeforeCommitWithLink() throws MalformedURLException, CoreExcepti
assertNotSame(msg, ctx.getMessage()); // issue info was added
}
- public void testAfterCommitLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HgHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.HG).setAfterCommit(true);
@@ -151,7 +146,7 @@ public void testAfterCommitLink() throws MalformedURLException, CoreException, I
assertFalse(HookIssue.getInstance().closed);
}
- public void testAfterCommitResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HgHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.HG).setAfterCommit(true);
@@ -171,7 +166,7 @@ public void testAfterCommitResolve() throws MalformedURLException, CoreException
assertTrue(HookIssue.getInstance().closed);
}
- public void testAfterCommitLinkResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitLinkResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HgHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.HG).setAfterCommit(true);
@@ -192,7 +187,7 @@ public void testAfterCommitLinkResolve() throws MalformedURLException, CoreExcep
assertTrue(HookIssue.getInstance().closed);
}
- public void testAfterCommitLinkResolveAfterPush() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitLinkResolveAfterPush() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
HookIssue.getInstance().reset();
HgHookImpl hook = getHook();
diff --git a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java
index 6b6d0cbf2061..a5441bdb8b48 100644
--- a/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java
+++ b/ide/bugtracking.bridge/test/unit/src/org/netbeans/modules/bugtracking/vcs/SvnHookTest.java
@@ -24,7 +24,6 @@
import java.io.IOException;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
import java.net.MalformedURLException;
import java.util.Arrays;
import java.util.Collection;
@@ -32,14 +31,10 @@
import java.util.logging.Level;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JComboBox;
-import org.eclipse.core.runtime.CoreException;
import org.netbeans.junit.NbTestCase;
import org.netbeans.junit.RandomlyFails;
-import org.netbeans.modules.bugtracking.IssueImpl;
import org.netbeans.modules.bugtracking.TestKit;
-import org.netbeans.modules.bugtracking.api.IssueQuickSearch;
import org.netbeans.modules.bugtracking.api.Repository;
-import org.netbeans.modules.bugtracking.ui.search.QuickSearchComboBar;
import org.netbeans.modules.bugtracking.ui.search.QuickSearchPanel;
import org.netbeans.modules.bugtracking.vcs.VCSHooksConfig.HookType;
import org.netbeans.modules.versioning.hooks.SvnHook;
@@ -68,7 +63,7 @@ protected void setUp() throws Exception {
}
@RandomlyFails
- public void testPanel() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testPanel() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
SvnHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.SVN).setLink(true);
@@ -98,7 +93,7 @@ public void testPanel() throws MalformedURLException, CoreException, IOException
assertFalse(panel.resolveCheckBox.isSelected());
}
- public void testBeforeCommitNoLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testBeforeCommitNoLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
SvnHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.SVN).setLink(false);
@@ -111,7 +106,7 @@ public void testBeforeCommitNoLink() throws MalformedURLException, CoreException
assertNull(ctx);
}
- public void testBeforeCommitWithLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testBeforeCommitWithLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
SvnHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.SVN).setLink(true);
@@ -127,7 +122,7 @@ public void testBeforeCommitWithLink() throws MalformedURLException, CoreExcepti
assertNotSame(msg, ctx.getMessage()); // issue info was added
}
- public void testAfterCommitLink() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitLink() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
SvnHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.SVN).setLink(true);
@@ -147,7 +142,7 @@ public void testAfterCommitLink() throws MalformedURLException, CoreException, I
assertFalse(HookIssue.getInstance().closed);
}
- public void testAfterCommitResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
SvnHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.SVN).setLink(false);
@@ -166,7 +161,7 @@ public void testAfterCommitResolve() throws MalformedURLException, CoreException
assertTrue(HookIssue.getInstance().closed);
}
- public void testAfterCommitLinkResolve() throws MalformedURLException, CoreException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
+ public void testAfterCommitLinkResolve() throws MalformedURLException, IOException, InterruptedException, NoSuchFieldException, IllegalArgumentException, IllegalAccessException, NoSuchMethodException, InvocationTargetException {
SvnHookImpl hook = getHook();
VCSHooksConfig.getInstance(HookType.SVN).setLink(true);
diff --git a/ide/bugtracking.commons/nbproject/project.properties b/ide/bugtracking.commons/nbproject/project.properties
index 6abe2615bd7b..430766bd6587 100644
--- a/ide/bugtracking.commons/nbproject/project.properties
+++ b/ide/bugtracking.commons/nbproject/project.properties
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
+is.autoload=true
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
diff --git a/ide/bugtracking.commons/nbproject/project.xml b/ide/bugtracking.commons/nbproject/project.xml
index c393881ab53f..b84e7f51d658 100644
--- a/ide/bugtracking.commons/nbproject/project.xml
+++ b/ide/bugtracking.commons/nbproject/project.xml
@@ -146,18 +146,9 @@
-
- org.netbeans.modules.bugzilla
- org.netbeans.modules.jira
- org.netbeans.modules.odcs.tasks
- org.netbeans.modules.localtasks
- com.oracle.netbeans.bugdb
-
- com.junichi11.netbeans.github.issues
-
- com.junichi11.netbeans.backlog.plugin
+
org.netbeans.modules.bugtracking.issuetable
-
+
diff --git a/ide/bugtracking/nbproject/project.properties b/ide/bugtracking/nbproject/project.properties
index a3810e58496a..6b2282f4eb1e 100644
--- a/ide/bugtracking/nbproject/project.properties
+++ b/ide/bugtracking/nbproject/project.properties
@@ -15,6 +15,7 @@
# specific language governing permissions and limitations
# under the License.
+is.autoload=true
javac.source=1.8
javac.compilerargs=-Xlint -Xlint:-serial
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java
index 1183e7abf23e..5b1add58f18d 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/BugtrackingManager.java
@@ -200,6 +200,10 @@ public static boolean isLocalConnectorID (String connectorID) {
return LOCAL_CONNECTOR_ID.equals(connectorID);
}
+ public boolean hasRegisteredConnectors() {
+ return getConnectors().length > 0;
+ }
+
public void addPropertyChangeListener(PropertyChangeListener listener) {
support.addPropertyChangeListener(listener);
}
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties b/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties
deleted file mode 100644
index dd4d3361425d..000000000000
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/Bundle.properties
+++ /dev/null
@@ -1,21 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-MissingJiraSupportPanel.downloadButton.text=Download JIRA plugin
-LBL_FakeJiraNameTooltip=Jira Task Repository
-LBL_FakeJiraName=JIRA
-MSG_NOT_YET_INSTALLED=
The JIRA plugin is not installed.
\ No newline at end of file
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java
deleted file mode 100644
index bdedf180d733..000000000000
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/jira/FakeJiraConnector.java
+++ /dev/null
@@ -1,200 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugtracking.jira;
-
-import java.awt.Image;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.beans.PropertyChangeListener;
-import java.util.Collection;
-import java.util.Collections;
-import javax.swing.GroupLayout;
-import javax.swing.JButton;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JPanel;
-import javax.swing.LayoutStyle;
-import javax.swing.event.ChangeListener;
-import org.netbeans.modules.bugtracking.DelegatingConnector;
-import org.netbeans.modules.bugtracking.api.Repository;
-import org.netbeans.modules.bugtracking.spi.BugtrackingConnector;
-import org.netbeans.modules.bugtracking.spi.BugtrackingSupport;
-import org.netbeans.modules.bugtracking.spi.RepositoryController;
-import org.netbeans.modules.bugtracking.spi.RepositoryInfo;
-import org.netbeans.modules.bugtracking.spi.RepositoryProvider;
-import org.netbeans.modules.bugtracking.commons.JiraUpdater;
-import org.openide.util.HelpCtx;
-import org.openide.util.ImageUtilities;
-import org.openide.util.NbBundle;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class FakeJiraConnector {
- private static DelegatingConnector connector;
-
- /**
- * Returns a fake {@link BugtrackingConnector} to be shown in the create
- * repository dialog. The repository controller panel notifies a the missing
- * JIRA plugin and comes with a button to download it from the Update Center.
- *
- * @return
- */
- public static synchronized DelegatingConnector getConnector() {
- if(connector == null) {
- connector = new DelegatingConnector(
- new JiraProxyConnector(),
- "fake.jira.connector", // NOI18N
- NbBundle.getMessage(FakeJiraConnector.class, "LBL_FakeJiraName"), // NOI18N
- NbBundle.getMessage(FakeJiraConnector.class, "LBL_FakeJiraNameTooltip"), // NOI18N
- ImageUtilities.loadImage("org/netbeans/modules/bugtracking/ui/resources/repository.png", true));
- }
- return connector;
- }
-
- private static class JiraProxyConnector implements BugtrackingConnector {
- private BugtrackingSupport f = new BugtrackingSupport(new JiraProxyRepositoryProvider(), null, null);
- @Override
- public Repository createRepository() {
- return f.createRepository(f, null, null, null, null);
- }
- @Override
- public Repository createRepository(RepositoryInfo info) {
- throw new UnsupportedOperationException("Not supported yet."); // NOI18N
- }
- }
- private static class JiraProxyRepositoryProvider implements RepositoryProvider {
- @Override
- public Image getIcon(Object r) {
- return null;
- }
- @Override
- public RepositoryInfo getInfo(Object r) {
- return null;
- }
- @Override
- public Collection getIssues(Object r, String... id) {
- throw new UnsupportedOperationException("Not supported yet."); // NOI18N
- }
- @Override
- public void removed(Object r) { }
- @Override
- public RepositoryController getController(Object r) {
- return new JiraProxyController();
- }
- @Override
- public Object createIssue(Object r) {
- throw new UnsupportedOperationException("Not supported yet."); // NOI18N
- }
- @Override
- public Object createQuery(Object r) {
- throw new UnsupportedOperationException("Not supported yet."); // NOI18N
- }
- @Override
- public Collection getQueries(Object r) {
- return Collections.emptyList();
- }
- @Override
- public Collection simpleSearch(Object r, String criteria) {
- return Collections.emptyList();
- }
- @Override
- public void removePropertyChangeListener(Object r, PropertyChangeListener listener) {
- // do nothing
- }
- @Override
- public void addPropertyChangeListener(Object r, PropertyChangeListener listener) {
- // do nothing
- }
- @Override
- public Object createIssue(Object r, String summary, String description) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- @Override
- public boolean canAttachFiles(Object r) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
- }
-
- private static class JiraProxyController implements RepositoryController {
- private JPanel panel;
- @Override
- public JComponent getComponent() {
- if(panel == null) {
- panel = createControllerPanel();
- }
- return panel;
- }
- @Override
- public HelpCtx getHelpCtx() {
- return new HelpCtx(this.getClass());
- }
- @Override
- public boolean isValid() {
- return false;
- }
- private JPanel createControllerPanel() {
- JPanel controllerPanel = new JPanel();
-
- JLabel pane = new JLabel();
- pane.setText(NbBundle.getMessage(FakeJiraConnector.class, "MSG_NOT_YET_INSTALLED")); // NOI18N
-
- JButton downloadButton = new JButton();
- downloadButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- JiraUpdater.getInstance().downloadAndInstall(null);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(downloadButton, org.openide.util.NbBundle.getMessage(FakeJiraConnector.class, "MissingJiraSupportPanel.downloadButton.text")); // NOI18N
-
- GroupLayout layout = new GroupLayout(controllerPanel);
- controllerPanel.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addComponent(pane, GroupLayout.PREFERRED_SIZE, 100, Short.MAX_VALUE))
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(downloadButton))
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(GroupLayout.Alignment.LEADING)
- .addGroup(GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
- .addComponent(pane)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(downloadButton))
- .addContainerGap())
- );
-
- return controllerPanel;
- }
-
- @Override public String getErrorMessage() { return null; }
- @Override public void applyChanges() { }
- @Override public void cancelChanges() { }
- @Override public void populate() {}
- @Override public void addChangeListener(ChangeListener l) {}
- @Override public void removeChangeListener(ChangeListener l) {}
- }
-}
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java
index 2884fa2359d3..1008f8c4c7de 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueAction.java
@@ -61,6 +61,11 @@ public String getName() {
return NbBundle.getMessage(IssueAction.class, "CTL_IssueAction");
}
+ @Override
+ public boolean isEnabled() {
+ return BugtrackingManager.getInstance().hasRegisteredConnectors();
+ }
+
@Override
public HelpCtx getHelpCtx() {
return new HelpCtx(IssueAction.class);
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java
index 9844d3e0e80e..6dd10d473929 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/issue/IssueTopComponent.java
@@ -108,12 +108,8 @@ public IssueTopComponent() {
RepositoryRegistry.getInstance().addPropertyChangeListener(this);
preparingLabel.setVisible(false);
- newButton.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- onNewClick();
- }
- });
+ newButton.addActionListener(this::onNewClick);
+ newButton.setEnabled(BugtrackingManager.getInstance().hasRegisteredConnectors());
JComponent findBar = FindSupport.create(this).getFindBar();
findBar.setVisible(false);
issuePanel.add(findBar, BorderLayout.PAGE_END);
@@ -344,7 +340,7 @@ private void initComponents() {
);
}// //GEN-END:initComponents
- private void onNewClick() {
+ private void onNewClick(ActionEvent evt) {
RepositoryImpl repoImpl = BugtrackingUtil.createRepository();
if(repoImpl != null) {
Repository repo = repoImpl.getRepository();
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java
index 039b887975f0..3c84d8d4c21f 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryAction.java
@@ -57,6 +57,11 @@ public String getName() {
return NbBundle.getMessage(QueryAction.class, "CTL_QueryAction"); // NOI18N
}
+ @Override
+ public boolean isEnabled() {
+ return BugtrackingManager.getInstance().hasRegisteredConnectors();
+ }
+
@Override
public HelpCtx getHelpCtx() {
return new HelpCtx(QueryAction.class);
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
index 109c09831b39..6f6a63cb9e06 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/query/QueryTopComponent.java
@@ -142,6 +142,7 @@ public final class QueryTopComponent extends TopComponent
getBundleText("QueryTopComponent.repositoryComboBox.AccessibleContext.accessibleDescription")); //NOI18N
newButton.getAccessibleContext().setAccessibleDescription(
getBundleText("QueryTopComponent.newButton.AccessibleContext.accessibleDescription")); //NOI18N
+ newButton.setEnabled(BugtrackingManager.getInstance().hasRegisteredConnectors());
/* background colors */
Color editorBgColor = UIManager.getDefaults()
diff --git a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java
index 5bd6d0bd3a5b..1651c8406fce 100644
--- a/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java
+++ b/ide/bugtracking/src/org/netbeans/modules/bugtracking/ui/selectors/RepositorySelector.java
@@ -26,10 +26,7 @@
import org.netbeans.modules.bugtracking.DelegatingConnector;
import org.netbeans.modules.bugtracking.RepositoryRegistry;
import org.netbeans.modules.bugtracking.RepositoryImpl;
-import org.netbeans.modules.bugtracking.jira.FakeJiraConnector;
import org.netbeans.modules.bugtracking.tasks.DashboardTopComponent;
-import org.netbeans.modules.bugtracking.util.BugtrackingUtil;
-import org.netbeans.modules.team.ide.spi.IDEServices;
/**
*
@@ -51,7 +48,6 @@ public RepositoryImpl create(boolean selectNode) {
}
}
connectors = l.toArray(new DelegatingConnector[0]);
- connectors = addJiraProxyIfNeeded(connectors);
selectorPanel.setConnectors(connectors);
boolean didCreate = selectorPanel.create();
final RepositoryImpl repo = selectorPanel.getRepository();
@@ -88,19 +84,4 @@ public boolean edit(RepositoryImpl repository, String errorMessage) {
RepositoryRegistry.getInstance().addRepository(repo);
return true;
}
-
- private DelegatingConnector[] addJiraProxyIfNeeded(DelegatingConnector[] connectors) {
- if(!BugtrackingUtil.isJiraInstalled() && supportsDownload()) {
- DelegatingConnector[] ret = new DelegatingConnector[connectors.length + 1];
- System.arraycopy(connectors, 0, ret, 0, connectors.length);
- ret[ret.length - 1] = FakeJiraConnector.getConnector();
- connectors = ret;
- }
- return connectors;
- }
-
- static boolean supportsDownload() {
- IDEServices ideServices = BugtrackingManager.getInstance().getIDEServices();
- return ideServices != null && ideServices.providesPluginUpdate();
- }
}
diff --git a/ide/bugzilla/build.xml b/ide/bugzilla/build.xml
deleted file mode 100644
index beefe06721d4..000000000000
--- a/ide/bugzilla/build.xml
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Builds, tests, and runs the project org.netbeans.modules.bugzilla
-
-
diff --git a/ide/bugzilla/licenseinfo.xml b/ide/bugzilla/licenseinfo.xml
deleted file mode 100644
index f479d5d6c16a..000000000000
--- a/ide/bugzilla/licenseinfo.xml
+++ /dev/null
@@ -1,39 +0,0 @@
-
-
-
-
- src/org/netbeans/modules/bugzilla/resources/p4.png
- src/org/netbeans/modules/bugzilla/resources/conflict.png
- src/org/netbeans/modules/bugzilla/resources/p5.png
- src/org/netbeans/modules/bugzilla/resources/p2.png
- src/org/netbeans/modules/bugzilla/resources/p1.png
- src/org/netbeans/modules/bugzilla/resources/p3.png
- src/org/netbeans/modules/bugzilla/resources/error.gif
- src/org/netbeans/modules/bugzilla/resources/info.png
- src/org/netbeans/modules/bugzilla/resources/remote.png
- src/org/netbeans/modules/bugzilla/resources/unsubmitted.png
- src/org/netbeans/modules/bugzilla/resources/warning.gif
- src/org/netbeans/modules/bugzilla/resources/repository.png
-
-
-
-
diff --git a/ide/bugzilla/manifest.mf b/ide/bugzilla/manifest.mf
deleted file mode 100644
index 22423e3996ab..000000000000
--- a/ide/bugzilla/manifest.mf
+++ /dev/null
@@ -1,6 +0,0 @@
-Manifest-Version: 1.0
-AutoUpdate-Show-In-Client: true
-OpenIDE-Module: org.netbeans.modules.bugzilla
-OpenIDE-Module-Localizing-Bundle: org/netbeans/modules/bugzilla/Bundle.properties
-OpenIDE-Module-Specification-Version: 1.108
-
diff --git a/ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig b/ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig
deleted file mode 100644
index cb7843f91610..000000000000
--- a/ide/bugzilla/nbproject/org-netbeans-modules-bugzilla.sig
+++ /dev/null
@@ -1,30 +0,0 @@
-#Signature file v4.1
-#Version 1.107
-
-CLSS public java.lang.Object
-cons public init()
-meth protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
-meth protected void finalize() throws java.lang.Throwable
-meth public boolean equals(java.lang.Object)
-meth public final java.lang.Class> getClass()
-meth public final void notify()
-meth public final void notifyAll()
-meth public final void wait() throws java.lang.InterruptedException
-meth public final void wait(long) throws java.lang.InterruptedException
-meth public final void wait(long,int) throws java.lang.InterruptedException
-meth public int hashCode()
-meth public java.lang.String toString()
-
-CLSS public org.netbeans.modules.bugzilla.api.NBBugzillaUtils
-cons public init()
-meth public static boolean isNbRepository(java.net.URL)
-meth public static char[] getNBPassword()
-meth public static java.lang.String getNBUsername()
-meth public static org.netbeans.modules.bugtracking.api.Repository findNBRepository()
-meth public static void attachFiles(java.lang.String,java.lang.String,java.lang.String[],java.lang.String[],java.io.File[])
-meth public static void openIssue(java.lang.String)
-meth public static void reportAnIssue()
-meth public static void saveNBPassword(char[])
-meth public static void saveNBUsername(java.lang.String)
-supr java.lang.Object
-
diff --git a/ide/bugzilla/nbproject/project.properties b/ide/bugzilla/nbproject/project.properties
deleted file mode 100644
index d6b7b56cc770..000000000000
--- a/ide/bugzilla/nbproject/project.properties
+++ /dev/null
@@ -1,31 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-javac.source=1.8
-javac.compilerargs=-Xlint -Xlint:-serial
-
-test.config.stableBTD.includes=**/*Test.class
-test.config.stableBTD.excludes=\
- org/netbeans/modules/bugzilla/commands/*,\
- org/netbeans/modules/bugzilla/repository/*,\
- **/BugzillaNotSupportedTest.class,\
- **/BugzillaSupportedTest.class,\
- **/BugzillaTest.class,\
- **/IssueTest.class,\
- **/MylynStorageTest.class,\
- **/QueryRefreshTest.class,\
- **/QueryTest.class
diff --git a/ide/bugzilla/nbproject/project.xml b/ide/bugzilla/nbproject/project.xml
deleted file mode 100644
index fb4543705b6c..000000000000
--- a/ide/bugzilla/nbproject/project.xml
+++ /dev/null
@@ -1,312 +0,0 @@
-
-
-
- org.netbeans.modules.apisupport.project
-
-
- org.netbeans.modules.bugzilla
-
-
- org.apache.commons.httpclient
-
-
-
- 3.1.0
-
-
-
- org.eclipse.core.runtime
-
-
-
- 3.7.0
-
-
-
- org.eclipse.equinox.common
-
-
-
- 3.6.0
-
-
-
- org.eclipse.mylyn.bugzilla.core
-
-
-
- 3.9.0
-
-
-
- org.eclipse.mylyn.commons.net
-
-
-
- 3.9.0
-
-
-
- org.eclipse.mylyn.tasks.core
-
-
-
- 3.9.0
-
-
-
- org.netbeans.api.progress
-
-
-
- 1
- 1.40
-
-
-
- org.netbeans.api.progress.nb
-
-
-
- 1.40
-
-
-
- org.netbeans.libs.osgi
-
-
-
- 1.6
-
-
-
- org.netbeans.modules.bugtracking
-
-
-
- 1.95
-
-
-
- org.netbeans.modules.bugtracking.commons
-
-
-
- 1.1
-
-
-
- org.netbeans.modules.mylyn.util
-
-
-
- 1.24
-
-
-
- org.netbeans.modules.options.api
-
-
-
- 1
- 1.29
-
-
-
- org.netbeans.modules.spellchecker.apimodule
-
-
-
- 1.3
-
-
-
- org.netbeans.modules.team.commons
-
-
-
- 1.50
-
-
-
- org.openide.awt
-
-
-
- 7.3
-
-
-
- org.openide.dialogs
-
-
-
- 7.9
-
-
-
- org.openide.filesystems
-
-
-
- 9.0
-
-
-
- org.openide.filesystems.nb
-
-
-
- 9.0
-
-
-
- org.openide.loaders
-
-
-
- 7.61
-
-
-
- org.openide.modules
-
-
-
- 6.0
-
-
-
- org.openide.nodes
-
-
-
- 7.23
-
-
-
- org.openide.util
-
-
-
- 9.3
-
-
-
- org.openide.util.lookup
-
-
-
- 8.0
-
-
-
- org.openide.util.ui
-
-
-
- 9.3
-
-
-
- org.openide.windows
-
-
-
- 6.24
-
-
-
-
-
- unit
-
- org.apache.xmlrpc
-
-
-
- com.google.guava
-
-
-
- org.eclipse.mylyn.commons.repositories.core
-
-
-
- org.eclipse.core.net
-
-
-
- org.eclipse.equinox.security
-
-
-
-
- org.eclipse.mylyn.commons.core
-
-
-
- org.netbeans.libs.junit4
-
-
-
- org.netbeans.modules.bugtracking
-
-
-
-
- org.netbeans.modules.bugtracking.commons
-
-
-
-
- org.netbeans.modules.team.commons
-
-
-
-
- org.netbeans.modules.bugzilla
-
-
-
- org.netbeans.modules.nbjunit
-
-
-
-
- org.netbeans.modules.netbinox
-
-
-
- org.openide.util.lookup
-
-
-
-
-
-
- org.netbeans.modules.bugzilla.exceptionreporter
- org.netbeans.modules.bugzilla.api
-
-
-
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java
deleted file mode 100644
index 17c2618b09ab..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bugzilla.java
+++ /dev/null
@@ -1,259 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla;
-
-import java.beans.PropertyChangeListener;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClientManager;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import java.net.MalformedURLException;
-import java.util.Collection;
-import java.util.Date;
-import java.util.List;
-import java.util.logging.Logger;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
-import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
-import org.netbeans.modules.bugtracking.commons.SimpleIssueFinder;
-import org.netbeans.modules.bugtracking.issuetable.IssueNode;
-import org.netbeans.modules.bugtracking.spi.BugtrackingSupport;
-import org.netbeans.modules.bugtracking.spi.IssueFinder;
-import org.netbeans.modules.bugtracking.spi.IssuePriorityInfo;
-import org.netbeans.modules.bugtracking.spi.IssuePriorityProvider;
-import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo;
-import org.netbeans.modules.bugtracking.spi.IssueScheduleProvider;
-import org.netbeans.modules.bugtracking.spi.IssueStatusProvider;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.query.BugzillaQuery;
-import org.netbeans.modules.mylyn.util.MylynSupport;
-import org.openide.util.RequestProcessor;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class Bugzilla {
-
- private BugzillaRepositoryConnector brc;
- private static Bugzilla instance;
-
- public static final Logger LOG = Logger.getLogger("org.netbeans.modules.bugzilla.Bugzilla"); // NOI18N
-
- private RequestProcessor rp;
- private BugzillaClientManager clientManager;
-
- private BugtrackingSupport bf;
- private BugzillaIssueProvider bip;
- private BugzillaQueryProvider bqp;
- private BugzillaRepositoryProvider brp;
- private IssueStatusProvider sp;
- private IssuePriorityProvider pp;
- private IssueNode.ChangesProvider bcp;
- private IssueScheduleProvider schedulingProvider;
- private IssueFinder issueFinder;
-
- private Bugzilla() {
- brc = MylynRepositoryConnectorProvider.getInstance().getConnector();
- clientManager = brc.getClientManager();
- MylynSupport.getInstance().addRepositoryListener(clientManager);
- }
-
- public static synchronized Bugzilla getInstance() {
- if(instance == null) {
- instance = new Bugzilla();
- }
- return instance;
- }
-
- static synchronized void init() {
- getInstance();
- }
-
- public BugzillaRepositoryConnector getRepositoryConnector() {
- return brc;
- }
-
- public RepositoryConfiguration getRepositoryConfiguration(BugzillaRepository repository, boolean forceRefresh) throws CoreException, MalformedURLException {
- getClient(repository); // XXX mylyn 3.1.1 workaround. initialize the client, otherwise the configuration will be downloaded twice
- RepositoryConfiguration rc = brc.getRepositoryConfiguration(repository.getTaskRepository(), forceRefresh, new NullProgressMonitor());
- return rc;
- }
-
- /**
- * Returns a BugzillaClient for the given repository
- * @param repository
- * @return
- * @throws java.net.MalformedURLException
- * @throws org.eclipse.core.runtime.CoreException
- */
- public BugzillaClient getClient(BugzillaRepository repository) throws MalformedURLException, CoreException {
- return clientManager.getClient(repository.getTaskRepository(), new NullProgressMonitor());
- }
-
- /**
- * Returns the request processor for common tasks in bugzilla.
- * Do not use this when accesing a remote repository.
- *
- * @return
- */
- public final RequestProcessor getRequestProcessor() {
- if(rp == null) {
- rp = new RequestProcessor("Bugzilla", 1, true); // NOI18N
- }
- return rp;
- }
-
- public BugtrackingSupport getBugtrackingFactory() {
- if(bf == null) {
- bf = new BugtrackingSupport<>(getRepositoryProvider(), getQueryProvider(), getIssueProvider());
- }
- return bf;
- }
-
- public BugzillaIssueProvider getIssueProvider() {
- if(bip == null) {
- bip = new BugzillaIssueProvider();
- }
- return bip;
- }
- public BugzillaQueryProvider getQueryProvider() {
- if(bqp == null) {
- bqp = new BugzillaQueryProvider();
- }
- return bqp;
- }
- public BugzillaRepositoryProvider getRepositoryProvider() {
- if(brp == null) {
- brp = new BugzillaRepositoryProvider();
- }
- return brp;
- }
-
- public IssueStatusProvider getStatusProvider() {
- if(sp == null) {
- sp = new IssueStatusProvider() {
- @Override
- public IssueStatusProvider.Status getStatus(BugzillaIssue issue) {
- return issue.getStatus();
- }
- @Override
- public void setSeenIncoming(BugzillaIssue issue, boolean uptodate) {
- issue.setUpToDate(uptodate);
- }
- @Override
- public void removePropertyChangeListener(BugzillaIssue issue, PropertyChangeListener listener) {
- issue.removePropertyChangeListener(listener);
- }
- @Override
- public void addPropertyChangeListener(BugzillaIssue issue, PropertyChangeListener listener) {
- issue.addPropertyChangeListener(listener);
- }
- @Override
- public Collection getUnsubmittedIssues(BugzillaRepository r) {
- return r.getUnsubmittedIssues();
- }
- @Override
- public void discardOutgoing(BugzillaIssue i) {
- i.discardLocalEdits();
- }
- @Override
- public boolean submit (BugzillaIssue data) {
- return data.submitAndRefresh();
- }
- };
- }
- return sp;
- }
-
- public IssuePriorityProvider createPriorityProvider(final BugzillaRepository repository) {
- return new IssuePriorityProvider() {
- private IssuePriorityInfo[] infos;
- @Override
- public String getPriorityID(BugzillaIssue i) {
- return i.getPriority();
- }
-
- @Override
- public synchronized IssuePriorityInfo[] getPriorityInfos() {
- if(infos == null) {
- List priorities = repository.getConfiguration().getPriorities();
- infos = new IssuePriorityInfo[priorities.size()];
- for (int i = 0; i < priorities.size(); i++) {
- String p = priorities.get(i);
- infos[i] = new IssuePriorityInfo(p, p);
- }
- }
- return infos;
- }
- };
- }
-
- public IssueScheduleProvider getSchedulingProvider() {
- if(schedulingProvider == null) {
- schedulingProvider = new IssueScheduleProvider() {
-
- @Override
- public void setSchedule (BugzillaIssue i, IssueScheduleInfo date) {
- i.setTaskScheduleDate(date, true);
- }
-
- @Override
- public Date getDueDate (BugzillaIssue i) {
- return i.getPersistentDueDate();
- }
-
- @Override
- public IssueScheduleInfo getSchedule (BugzillaIssue i) {
- return i.getPersistentScheduleInfo();
- }
- };
- }
- return schedulingProvider;
- }
-
- public IssueNode.ChangesProvider getChangesProvider() {
- if(bcp == null) {
- bcp = new IssueNode.ChangesProvider() {
- @Override
- public String getRecentChanges(BugzillaIssue i) {
- return i.getRecentChanges();
- }
- };
- }
- return bcp;
- }
-
- public IssueFinder getBugzillaIssueFinder() {
- if(issueFinder == null) {
- issueFinder = new IssueFinder() {
- @Override
- public int[] getIssueSpans(CharSequence text) {
- return SimpleIssueFinder.getInstance().getIssueSpans(text);
- }
- @Override
- public String getIssueId(String issueHyperlinkText) {
- return SimpleIssueFinder.getInstance().getIssueId(issueHyperlinkText);
- }
- };
- }
- return issueFinder;
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java
deleted file mode 100644
index 40a7c9545c65..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConfig.java
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla;
-
-import java.net.URL;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.prefs.BackingStoreException;
-import java.util.prefs.Preferences;
-import javax.swing.Icon;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.netbeans.modules.bugzilla.query.BugzillaQuery;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.netbeans.modules.mylyn.util.MylynSupport;
-import org.openide.modules.Places;
-import org.openide.util.ImageUtilities;
-import org.openide.util.NbPreferences;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaConfig {
-
- private static BugzillaConfig instance = null;
- private static final String LAST_CHANGE_FROM = "bugzilla.last_change_from"; // NOI18N // XXX
- private static final String QUERY_NAME = "bugzilla.query_"; // NOI18N
- private static final String QUERY_LAST_REFRESH = "bugzilla.query_last_refresh"; // NOI18N
- private static final String DELIMITER = "<=>"; // NOI18N
- private static final String ATTACH_LOG = "bugzilla.attach_log"; // NOI18N;
- private static final String PREF_SECTION_COLLAPSED = "collapsedSection"; //NOI18N
- private static final String PREF_TASK = "task."; //NOI18N
- private static final Level LOG_LEVEL = BugzillaUtil.isAssertEnabled() ? Level.SEVERE : Level.INFO;
-
- public static final int DEFAULT_QUERY_REFRESH = 30;
- public static final int DEFAULT_ISSUE_REFRESH = 15;
- private Map priorityIcons;
- private Map priorityIconsURL;
-
- private BugzillaConfig() { }
-
- public static BugzillaConfig getInstance() {
- if(instance == null) {
- instance = new BugzillaConfig();
- }
- return instance;
- }
-
- private Preferences getPreferences() {
- return NbPreferences.forModule(BugzillaConfig.class);
- }
-
- public boolean getAttachLogFile() {
- return getPreferences().getBoolean(ATTACH_LOG, true);
- }
-
- public void putAttachLogFile(boolean attach) {
- getPreferences().putBoolean(ATTACH_LOG, attach);
- }
-
- public void putQuery(BugzillaRepository repository, BugzillaQuery query) {
- getPreferences().put(
- getQueryKey(repository.getID(), query.getDisplayName()),
- query.getUrlParameters() + DELIMITER + /* skip query.getLastRefresh() + */ DELIMITER + query.isUrlDefined());
- }
-
- public void removeQuery(BugzillaRepository repository, BugzillaQuery query) {
- getPreferences().remove(getQueryKey(repository.getID(), query.getDisplayName()));
- try {
- String storedName = query.getStoredQueryName();
- IRepositoryQuery iquery = storedName == null ? null
- : MylynSupport.getInstance().getRepositoryQuery(repository.getTaskRepository(), storedName);
- if (iquery != null) {
- MylynSupport.getInstance().deleteQuery(iquery);
- }
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- }
- }
-
- public BugzillaQuery getQuery(BugzillaRepository repository, String queryName) {
- String value = getStoredQuery(repository, queryName);
- if(value == null) {
- return null;
- }
- String[] values = value.split(DELIMITER);
- assert values.length >= 2 : "wrong amount of stored query data [" + values.length + "] in query '" + queryName + "'"; // NOI18N
- String urlParams = values[0];
- boolean urlDef = values.length > 2 ? Boolean.parseBoolean(values[2]) : false;
- return repository.createPersistentQuery(queryName, urlParams, urlDef);
- }
-
- public String getUrlParams(BugzillaRepository repository, String queryName) {
- String value = getStoredQuery(repository, queryName);
- if(value == null) {
- return null;
- }
- String[] values = value.split(DELIMITER);
- assert values.length >= 2;
- return values[0];
- }
-
- public String[] getQueries(String repoID) {
- return getKeysWithPrefix(QUERY_NAME + repoID + DELIMITER);
- }
-
- public long getLastQueryRefresh(BugzillaRepository repository, String queryName) {
- return getPreferences().getLong(QUERY_LAST_REFRESH + "_" + getQueryKey(repository.getID(), queryName), -1); // NOI18N
- }
-
- public void putLastQueryRefresh(BugzillaRepository repository, String queryName, long lastRefresh) {
- getPreferences().putLong(QUERY_LAST_REFRESH + "_" + getQueryKey(repository.getID(), queryName), lastRefresh); // NOI18N
- }
-
- private String[] getKeysWithPrefix(String prefix) {
- String[] keys = null;
- try {
- keys = getPreferences().keys();
- } catch (BackingStoreException ex) {
- Bugzilla.LOG.log(Level.SEVERE, null, ex); // XXX
- }
- if (keys == null || keys.length == 0) {
- return new String[0];
- }
- List ret = new ArrayList<>();
- for (String key : keys) {
- if (key.startsWith(prefix)) {
- ret.add(key.substring(prefix.length()));
- }
- }
- return ret.toArray(new String[0]);
- }
-
- private String getQueryKey(String repositoryID, String queryName) {
- return QUERY_NAME + repositoryID + DELIMITER + queryName;
- }
-
- private String getStoredQuery(BugzillaRepository repository, String queryName) {
- String value = getPreferences().get(getQueryKey(repository.getID(), queryName), null);
- return value;
- }
-
- public void setLastChangeFrom(String value) {
- getPreferences().put(LAST_CHANGE_FROM, value);
- }
-
- public String getLastChangeFrom() {
- return getPreferences().get(LAST_CHANGE_FROM, ""); // NOI18N
- }
-
- public Icon getPriorityIcon(String priority) {
- if(priorityIcons == null) {
- priorityIcons = new HashMap();
- priorityIcons.put("P1", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p1.png", true)); // NOI18N
- priorityIcons.put("P2", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p2.png", true)); // NOI18N
- priorityIcons.put("P3", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p3.png", true)); // NOI18N
- priorityIcons.put("P4", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p4.png", true)); // NOI18N
- priorityIcons.put("P5", ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/p5.png", true)); // NOI18N
- }
- return priorityIcons.get(priority);
- }
-
- public URL getPriorityIconURL(String priority) {
- if(priorityIconsURL == null) {
- priorityIconsURL = new HashMap<>();
- priorityIconsURL.put("P1", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p1.png")); // NOI18N
- priorityIconsURL.put("P2", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p2.png")); // NOI18N
- priorityIconsURL.put("P3", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p3.png")); // NOI18N
- priorityIconsURL.put("P4", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p4.png")); // NOI18N
- priorityIconsURL.put("P5", BugzillaConfig.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/p5.png")); // NOI18N
- }
- return priorityIconsURL.get(priority);
- }
-
- public void setEditorSectionCollapsed (String repositoryId, String taskId, String sectionName, boolean collapsed) {
- String key = getTaskKey(repositoryId, taskId) + PREF_SECTION_COLLAPSED + sectionName;
- getPreferences().putBoolean(key, collapsed);
- }
-
- public boolean isEditorSectionCollapsed (String repositoryId, String taskId, String sectionName, boolean defaultValue) {
- String key = getTaskKey(repositoryId, taskId) + PREF_SECTION_COLLAPSED + sectionName;
- return getPreferences().getBoolean(key, defaultValue);
- }
-
- private String getTaskKey (String repositoryId, String taskId) {
- return PREF_TASK + repositoryId + "." + taskId + ".";
- }
-
- /**
- * Returns the path for the Bugzilla configuration directory.
- *
- * @return the path
- *
- */
- private static String getNBConfigPath() {
- //T9Y - nb bugzilla confing should be changable
- String t9yNbConfigPath = System.getProperty("netbeans.t9y.bugzilla.nb.config.path"); //NOI18N
- if (t9yNbConfigPath != null && t9yNbConfigPath.length() > 0) {
- return t9yNbConfigPath;
- }
- String nbHome = Places.getUserDirectory().getAbsolutePath(); //NOI18N
- return nbHome + "/config/issue-tracking/org-netbeans-modules-bugzilla"; //NOI18N
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java
deleted file mode 100644
index 04df3ab58e0d..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaConnector.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla;
-
-import org.netbeans.modules.bugtracking.api.Repository;
-import org.netbeans.modules.team.spi.TeamBugtrackingConnector;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugtracking.spi.BugtrackingConnector;
-import org.netbeans.modules.bugtracking.spi.RepositoryInfo;
-import org.netbeans.modules.bugzilla.api.NBBugzillaUtils;
-import org.netbeans.modules.bugzilla.repository.NBRepositorySupport;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.openide.util.NbBundle;
-
-/**
- *
- * @author Tomas Stupka
- */
-@BugtrackingConnector.Registration (
- id=BugzillaConnector.ID,
- displayName="#LBL_ConnectorName",
- tooltip="#LBL_ConnectorTooltip",
- iconPath = "org/netbeans/modules/bugzilla/resources/repository.png"
-)
-public class BugzillaConnector implements BugtrackingConnector, TeamBugtrackingConnector {
-
- public static final String ID = "org.netbeans.modules.bugzilla";
-
- public BugzillaConnector() {}
-
- @Override
- public Repository createRepository(RepositoryInfo info) {
- BugzillaRepository bugzillaRepository = new BugzillaRepository(info);
- if(BugzillaUtil.isNbRepository(bugzillaRepository)) {
- NBRepositorySupport.getInstance().setNBBugzillaRepository(bugzillaRepository);
- }
- return BugzillaUtil.createRepository(bugzillaRepository);
- }
-
- @Override
- public Repository createRepository() {
- Bugzilla.init();
- return BugzillaUtil.createRepository(new BugzillaRepository());
- }
-
- public static String getConnectorName() {
- return NbBundle.getMessage(BugzillaConnector.class, "LBL_ConnectorName"); // NOI18N
- }
-
- @Override
- public BugtrackingType getType() {
- return BugtrackingType.BUGZILLA;
- }
-
- @Override
- public String findNBRepository() {
- return NBBugzillaUtils.findNBRepository().getId();
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java
deleted file mode 100644
index ecc52eb59a12..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaIssueProvider.java
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.netbeans.modules.bugzilla;
-
-import java.beans.PropertyChangeListener;
-import java.io.File;
-import java.util.Collection;
-import org.netbeans.modules.bugtracking.spi.IssueController;
-import org.netbeans.modules.bugtracking.spi.IssueProvider;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.repository.IssueField;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaIssueProvider implements IssueProvider {
-
- @Override
- public String getDisplayName(BugzillaIssue data) {
- return data.getDisplayName();
- }
-
- @Override
- public String getTooltip(BugzillaIssue data) {
- return data.getTooltip();
- }
-
- @Override
- public String getID(BugzillaIssue data) {
- return data.getID();
- }
-
- @Override
- public Collection getSubtasks(BugzillaIssue data) {
- return data.getRepositoryFieldValues(IssueField.BLOCKS);
- }
-
- @Override
- public String getSummary(BugzillaIssue data) {
- return data.getSummary();
- }
-
- @Override
- public boolean isNew(BugzillaIssue data) {
- return data.isNew();
- }
-
- @Override
- public boolean isFinished(BugzillaIssue data) {
- return data.isFinished();
- }
-
- @Override
- public boolean refresh(BugzillaIssue data) {
- return data.refresh();
- }
-
- @Override
- public void addComment(BugzillaIssue data, String comment, boolean closeAsFixed) {
- data.addComment(comment, closeAsFixed);
- }
-
- @Override
- public void attachFile(BugzillaIssue data, File file, String description, boolean isPatch) {
- data.attachPatch(file, description, isPatch);
- }
-
- @Override
- public IssueController getController(BugzillaIssue data) {
- return data.getController();
- }
-
- @Override
- public void removePropertyChangeListener(BugzillaIssue data, PropertyChangeListener listener) {
- data.removePropertyChangeListener(listener);
- }
-
- @Override
- public void addPropertyChangeListener(BugzillaIssue data, PropertyChangeListener listener) {
- data.addPropertyChangeListener(listener);
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java
deleted file mode 100644
index 116d93b50089..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaQueryProvider.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.netbeans.modules.bugzilla;
-
-import org.netbeans.modules.bugtracking.spi.QueryController;
-import org.netbeans.modules.bugtracking.spi.QueryProvider;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.query.BugzillaQuery;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaQueryProvider implements QueryProvider {
-
- @Override
- public String getDisplayName(BugzillaQuery query) {
- return query.getDisplayName();
- }
-
- @Override
- public String getTooltip(BugzillaQuery query) {
- return query.getTooltip();
- }
-
- @Override
- public QueryController getController(BugzillaQuery query) {
- return query.getController();
- }
-
- @Override
- public boolean canRemove(BugzillaQuery q) {
- return q.canRemove();
- }
-
- @Override
- public void remove(BugzillaQuery q) {
- q.remove();
- }
-
- @Override
- public boolean canRename(BugzillaQuery q) {
- return true;
- }
-
- @Override
- public void rename(BugzillaQuery q, String displayName) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- @Override
- public void setIssueContainer(BugzillaQuery query, IssueContainer c) {
- query.getController().setContainer(c);
- }
-
- @Override
- public void refresh(BugzillaQuery query) {
- query.getController().refresh(true);
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java
deleted file mode 100644
index 29ca911f5551..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/BugzillaRepositoryProvider.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.netbeans.modules.bugzilla;
-
-import java.awt.Image;
-import java.beans.PropertyChangeListener;
-import java.util.Collection;
-import org.netbeans.modules.bugtracking.spi.RepositoryController;
-import org.netbeans.modules.bugtracking.spi.RepositoryInfo;
-import org.netbeans.modules.bugtracking.spi.RepositoryProvider;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.query.BugzillaQuery;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.team.spi.NBRepositoryProvider;
-import org.netbeans.modules.team.spi.OwnerInfo;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaRepositoryProvider implements RepositoryProvider, NBRepositoryProvider {
-
- @Override
- public Image getIcon(BugzillaRepository r) {
- return r.getIcon();
- }
-
- @Override
- public RepositoryInfo getInfo(BugzillaRepository r) {
- return r.getInfo();
- }
-
- @Override
- public void removed(BugzillaRepository r) {
- r.remove();
- }
-
- @Override
- public RepositoryController getController(BugzillaRepository r) {
- return r.getController();
- }
-
- @Override
- public BugzillaQuery createQuery(BugzillaRepository r) {
- return r.createQuery();
- }
-
- @Override
- public BugzillaIssue createIssue(BugzillaRepository r) {
- return r.createIssue();
- }
-
- @Override
- public Collection getQueries(BugzillaRepository r) {
- return r.getQueries();
- }
-
- @Override
- public Collection simpleSearch(BugzillaRepository r, String criteria) {
- return r.simpleSearch(criteria);
- }
-
- @Override
- public Collection getIssues(BugzillaRepository r, String... id) {
- return r.getIssues(id);
- }
-
- @Override
- public boolean canAttachFiles(BugzillaRepository r) {
- return true;
- }
-
- @Override
- public void removePropertyChangeListener(BugzillaRepository r, PropertyChangeListener listener) {
- r.removePropertyChangeListener(listener);
- }
-
- @Override
- public void addPropertyChangeListener(BugzillaRepository r, PropertyChangeListener listener) {
- r.addPropertyChangeListener(listener);
- }
-
- @Override
- public BugzillaIssue createIssue(BugzillaRepository r, String summary, String description) {
- throw new UnsupportedOperationException("Not supported yet."); //To change body of generated methods, choose Tools | Templates.
- }
-
- /************************************************************************************
- * NB Bugzilla
- ************************************************************************************/
-
- @Override
- public void setIssueOwnerInfo(BugzillaIssue i, OwnerInfo info) {
- i.setOwnerInfo(info);
- }
-
- @Override
- public void setQueryOwnerInfo(BugzillaQuery q, OwnerInfo info) {
- q.setOwnerInfo(info);
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties
deleted file mode 100644
index 75f05652ac00..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/Bundle.properties
+++ /dev/null
@@ -1,32 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-OpenIDE-Module-Display-Category=Base IDE
-OpenIDE-Module-Long-Description=\
- Support for Bugzilla task repository up to version 4.0
-## libs/jsch/manifest.mf
-OpenIDE-Module-Name=Bugzilla
-HtmlPanel.pane.contentType=text/html
-
-IssueTopComponent.addCommentButton.text=Add Comment
-LBL_Validating=Validating...
-
-LBL_ConnectorName = Bugzilla
-LBL_ConnectorTooltip = Bugzilla Task Repository
-OpenIDE-Module-Short-Description=Bugzilla
-
-LBL_NotLoggedIn=(Not logged in)
\ No newline at end of file
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java
deleted file mode 100644
index 8706d3b23d71..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/MylynRepositoryConnectorProvider.java
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.netbeans.modules.bugzilla;
-
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaRepositoryConnector;
-import org.netbeans.modules.mylyn.util.RepositoryConnectorProvider;
-import org.openide.util.Lookup;
-import org.openide.util.lookup.ServiceProvider;
-import org.openide.util.lookup.ServiceProviders;
-
-/**
- *
- * @author Ondrej Vrabec
- */
-@ServiceProviders({
- @ServiceProvider(service = RepositoryConnectorProvider.class),
- @ServiceProvider(service = MylynRepositoryConnectorProvider.class)
-})
-public final class MylynRepositoryConnectorProvider implements RepositoryConnectorProvider {
-
- private static MylynRepositoryConnectorProvider INSTANCE;
-
- private final BugzillaRepositoryConnector rc;
-
- public MylynRepositoryConnectorProvider () {
- rc = new BugzillaRepositoryConnector();
- }
-
- static MylynRepositoryConnectorProvider getInstance () {
- if (INSTANCE == null) {
- INSTANCE = Lookup.getDefault().lookup(MylynRepositoryConnectorProvider.class);
- }
- return INSTANCE;
- }
-
- @Override
- public BugzillaRepositoryConnector getConnector () {
- return rc;
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java
deleted file mode 100644
index c9c1bdaa00bb..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/api/NBBugzillaUtils.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.api;
-
-import java.io.File;
-import java.net.URL;
-import org.netbeans.modules.bugtracking.api.Repository;
-import org.netbeans.modules.bugtracking.api.Util;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugzilla.repository.NBRepositorySupport;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.openide.util.RequestProcessor;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class NBBugzillaUtils {
-
- /**
- * Opens in the IDE the given issue from the netbeans repository
- *
- * @param issueID issue identifier
- */
- public static void openIssue(String issueID) {
- Repository nbRepo = NBRepositorySupport.getInstance().getNBRepository(false);
- assert nbRepo != null;
- if(nbRepo == null) {
- Bugzilla.LOG.warning("No bugzilla repository available for netbeans.org"); // NOI18N
- return;
- }
- if(issueID != null) {
- Util.openIssue(nbRepo, issueID);
- } else {
- Util.createNewIssue(nbRepo);
- }
- }
-
- public static void reportAnIssue() {
- RequestProcessor.getDefault().post(new Runnable() {
- @Override
- public void run() {
- Repository nbRepo = NBRepositorySupport.getInstance().getNBRepository(true);
- if(nbRepo != null) {
- Util.createNewIssue(nbRepo);
- }
- }
- });
- }
-
- /**
- * Returns the netbeans.org username
- * Shouldn't be called in awt
- *
- * @return username
- */
- public static String getNBUsername() {
- return org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.getNBUsername();
- }
-
- /**
- * Returns the netbeans.org password
- * Shouldn't be called in awt
- *
- * @return password
- */
- public static char[] getNBPassword() {
- return org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.getNBPassword();
- }
-
- /**
- * Save the given username as a netbeans.org username.
- * Shouldn't be called in awt
- */
- public static void saveNBUsername(String username) {
- org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.saveNBUsername(username);
- }
-
- /**
- * Saves the given value as a netbeans.org password
- * Shouldn't be called in awt
- */
- public static void saveNBPassword(char[] password) {
- org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.saveNBPassword(password);
- }
-
- /**
- * Determines wheter the given url is a netbeans.org url or not
- *
- * @return true if the given url is netbeans.org url, otherwise false
- */
- public static boolean isNbRepository(URL url) {
- assert url != null;
- return org.netbeans.modules.bugtracking.commons.NBBugzillaUtils.isNbRepository(url.toString());
- }
-
- public static Repository findNBRepository() {
- return NBRepositorySupport.getInstance().getNBRepository(false);
- }
-
- /**
- * Attaches files to the issue with the given id.
- *
- * @param id issue id
- * @param comment comment to be added to the issue
- * @param desc attachment description per file
- * @param contentType content type per file
- * @param files files to be attached
- */
- public static void attachFiles(String id, String comment, String[] desc, String[] contentType, File[] files) {
- assert id != null;
- assert desc != null;
- assert files != null;
- assert contentType != null;
- assert desc.length == files.length;
- assert contentType.length == files.length;
-
- BugzillaRepository nbRepo = NBRepositorySupport.getInstance().getNBBugzillaRepository(false);
- BugzillaIssue issue = nbRepo.getIssue(id);
- if(issue == null) {
- return;
- }
- for (int i = 0; i < files.length; i++) {
- issue.addAttachment(files[i], comment, desc[i], contentType[i], false);
- }
- BugzillaUtil.openIssue(issue);
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java
deleted file mode 100644
index 2e08ea8acc9f..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/autoupdate/BugzillaAutoupdate.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.autoupdate;
-
-import java.util.Collections;
-import java.util.Set;
-import java.util.WeakHashMap;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
-import org.netbeans.modules.bugtracking.commons.AutoupdateSupport;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.openide.util.NbBundle;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaAutoupdate {
-
- public static final BugzillaVersion SUPPORTED_BUGZILLA_VERSION;
- static {
- String version = System.getProperty("netbeans.t9y.bugzilla.supported.version"); // NOI18N
- SUPPORTED_BUGZILLA_VERSION = version != null ? new BugzillaVersion(version) : BugzillaVersion.BUGZILLA_4_0; // NOI18N
- }
- static final String BUGZILLA_MODULE_CODE_NAME = "org.netbeans.modules.bugzilla"; // NOI18N
-
- private static final Pattern VERSION_PATTERN = Pattern.compile("^.*version ((\\d+?\\.\\d+?\\.\\d+?)|(\\d+?\\.\\d+?)).*$");
-
- private static BugzillaAutoupdate instance;
-
- private final Set repos = Collections.newSetFromMap(new WeakHashMap<>());
-
- private final AutoupdateSupport support = new AutoupdateSupport(new AutoupdateCallback(), BUGZILLA_MODULE_CODE_NAME, NbBundle.getMessage(Bugzilla.class, "LBL_ConnectorName"));
-
- private BugzillaAutoupdate() { }
-
- public static BugzillaAutoupdate getInstance() {
- if(instance == null) {
- instance = new BugzillaAutoupdate();
- }
- return instance;
- }
-
- /**
- * Checks if the remote Bugzilla repository has a version higher then actually
- * supported and if an update is available on the UC.
- *
- * @param repository the repository to check the version for
- */
- public void checkAndNotify(final BugzillaRepository repository) {
- synchronized(repos) {
- repos.add(repository);
- }
- support.checkAndNotify(repository.getUrl());
- }
-
- public boolean isSupportedVersion(BugzillaVersion version) {
- return version.compareTo(SUPPORTED_BUGZILLA_VERSION) <= 0;
- }
-
- public BugzillaVersion getVersion(String desc) {
- String[] lines = desc.split("\n");
- for (String l : lines) {
- Matcher m = VERSION_PATTERN.matcher(l);
- if(m.matches()) {
- return new BugzillaVersion(m.group(1)) ;
- }
- }
- return null;
- }
-
- public BugzillaVersion getServerVersion(BugzillaRepository repository) {
- BugzillaConfiguration conf = repository.getConfiguration();
- if(!conf.isValid()) {
- return null; // do not force the wrong version notification
- }
- BugzillaVersion version = conf.getInstalledVersion();
- return version;
- }
-
- public AutoupdateSupport getAutoupdateSupport() {
- return support;
- }
-
- class AutoupdateCallback implements AutoupdateSupport.Callback {
- @Override
- public String getServerVersion(String url) {
- BugzillaRepository repository = null;
- synchronized (repos) {
- for (BugzillaRepository r : repos) {
- if(r.getUrl().equals(url)) {
- repository = r;
- }
- }
- }
- assert repository != null : "no repository found for url " + url;
- if(repository == null) {
- return null;
- }
- BugzillaVersion version = BugzillaAutoupdate.this.getServerVersion(repository);
- return version != null ? version.toString() : null;
- }
-
- @Override
- public boolean checkIfShouldDownload(String desc) {
- BugzillaVersion version = getVersion(desc);
- return version != null && SUPPORTED_BUGZILLA_VERSION.compareTo(version) < 0;
- }
-
- @Override
- public boolean isSupportedVersion(String version) {
- return BugzillaAutoupdate.this.isSupportedVersion(new BugzillaVersion(version));
- }
- };
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java
deleted file mode 100644
index 1e61660164e4..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/AddAttachmentCommand.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.commands;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource;
-import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.mylyn.util.BugtrackingCommand;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class AddAttachmentCommand extends BugtrackingCommand {
-
- private final String id;
- private final BugzillaRepository repository;
- private final String comment;
- private final FileTaskAttachmentSource attachmentSource;
- private final TaskAttribute attAttribute;
- private final File file;
- private String stringValue;
-
- public AddAttachmentCommand(String id, BugzillaRepository repository, String comment, FileTaskAttachmentSource attachmentSource, File file, TaskAttribute attAttribute) {
- this.id = id;
- this.repository = repository;
- this.comment = comment;
- this.attachmentSource = attachmentSource;
- this.file = file;
- this.attAttribute = attAttribute;
- }
-
- @Override
- public void execute() throws CoreException, IOException, MalformedURLException {
- Bugzilla.getInstance().getClient(repository)
- .postAttachment(
- id,
- comment,
- attachmentSource,
- attAttribute,
- new NullProgressMonitor());
- }
-
- @Override
- public String toString() {
- if(stringValue == null) {
- StringBuilder sb = new StringBuilder();
- sb.append("AddAttachmentCommand [repository="); // NOI18N
- sb.append(repository.getUrl());
- sb.append(",id="); // NOI18N
- sb.append(id);
- sb.append(",comment="); // NOI18N
- sb.append(comment);
- sb.append(",file="); // NOI18N
- sb.append(file.getAbsolutePath());
- sb.append(",desc="); // NOI18N
- TaskAttribute ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION);
- sb.append(ta != null ? ta.getValue() : ""); // NOI18N
- sb.append(",patch="); // NOI18N
- ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_IS_PATCH);
- sb.append(ta != null ? ta.getValue() : ""); // NOI18N
- sb.append(",contentType="); // NOI18N
- ta = attAttribute.getMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE);
- sb.append(ta != null ? ta.getValue() : ""); // NOI18N
- sb.append("]"); // NOI18N
- stringValue = sb.toString();
- }
- return stringValue;
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java
deleted file mode 100644
index e7ecaa411ab7..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/BugzillaExecutor.java
+++ /dev/null
@@ -1,612 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.commands;
-
-import java.io.IOException;
-import java.net.ConnectException;
-import java.net.MalformedURLException;
-import java.net.NoRouteToHostException;
-import java.net.SocketTimeoutException;
-import java.net.UnknownHostException;
-import java.text.MessageFormat;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.concurrent.Callable;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaStatus;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaUserMatchResponse;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
-import org.eclipse.mylyn.tasks.core.RepositoryStatus;
-import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.autoupdate.BugzillaAutoupdate;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.mylyn.util.BugtrackingCommand;
-import org.netbeans.modules.mylyn.util.SubmitCommand;
-import org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand;
-import org.openide.DialogDescriptor;
-import org.openide.DialogDisplayer;
-import org.openide.NotifyDescriptor;
-import org.openide.util.Exceptions;
-import org.openide.util.HelpCtx;
-import org.openide.util.NbBundle;
-
-/**
- * Executes commands against one bugzilla Repository and handles errors
- *
- * @author Tomas Stupka
- */
-public class BugzillaExecutor {
-
- private static final String HTTP_ERROR_NOT_FOUND = "http error: not found"; // NOI18N
- private static final String EMPTY_PASSWORD = "Empty password not allowed to login"; // NOI18N
- private static final String USERNAME_CONFIRM_MATCH = "Confirm Match"; // NOI18N
- private static final String INVALID_USERNAME_OR_PASSWORD = "invalid username or password"; // NOI18N
- private static final String REPOSITORY_LOGIN_FAILURE = "unable to login to"; // NOI18N
- private static final String COULD_NOT_BE_FOUND = "could not be found"; // NOI18N
- private static final String REPOSITORY = "repository"; // NOI18N
- private static final String MIDAIR_COLLISION = "mid-air collision occurred while submitting to"; // NOI18N
-
- private final BugzillaRepository repository;
-
- private static final Map> handlerCalls = new HashMap<>();
-
- public BugzillaExecutor(BugzillaRepository repository) {
- this.repository = repository;
- }
-
- public void execute(BugtrackingCommand cmd) {
- execute(cmd, true);
- }
-
- public void execute(BugtrackingCommand cmd, boolean handleExceptions) {
- execute(cmd, handleExceptions, true);
- }
-
- public void execute(BugtrackingCommand cmd, boolean handleExceptions, boolean checkVersion) {
- execute(cmd, handleExceptions ? 0 : -1, checkVersion, true, true);
- }
-
- public void execute(BugtrackingCommand cmd, boolean handleExceptions, boolean checkVersion, boolean ensureCredentials) {
- execute(cmd, handleExceptions ? 0 : -1, checkVersion, ensureCredentials, true);
- }
-
- private void execute(BugtrackingCommand cmd, int handleCounter, boolean checkVersion, boolean ensureCredentials, boolean reexecute) {
- boolean handleExceptions = handleCounter++ > -1 && handleCounter < 10;
-
- try {
-
- cmd.setFailed(true);
-
- if(checkVersion) {
- checkAutoupdate();
- }
-
- if(ensureCredentials) {
- if( ( cmd instanceof AddAttachmentCommand ||
- cmd instanceof SubmitCommand )
- && !checkAndEnsureNBCredentials())
- {
- return;
- }
- repository.ensureCredentials();
- }
-
- Bugzilla.LOG.log(Level.FINE, "execute {0}", cmd); // NOI18N
- cmd.execute();
-
- if(cmd instanceof SynchronizeQueryCommand) {
- SynchronizeQueryCommand pqc = (SynchronizeQueryCommand) cmd;
- if(handleStatus(pqc, handleExceptions)) {
- return;
- }
- }
-
- cmd.setFailed(false);
- cmd.setErrorMessage(null);
-
- synchronized ( handlerCalls ) {
- handlerCalls.remove(repository.getUrl());
- }
-
- } catch (CoreException ce) {
- Bugzilla.LOG.log(Level.FINE, null, ce);
-
- ExceptionHandler handler;
- if(cmd instanceof ValidateCommand) {
- handler = ExceptionHandler.createHandler(ce, this, null, ((ValidateCommand)cmd), reexecute);
- } else {
- handler = ExceptionHandler.createHandler(ce, this, repository, null, reexecute);
- }
- assert handler != null;
-
- String msg = handler.getMessage();
-
- cmd.setFailed(true);
- cmd.setErrorMessage(msg);
-
- if(handleExceptions) {
- if(handler.handle()) {
- // execute again
- execute(cmd, handleCounter, checkVersion, ensureCredentials, !handler.reexecuteOnce());
- }
- }
- return;
-
- } catch(MalformedURLException me) {
- cmd.setErrorMessage(me.getMessage());
- Bugzilla.LOG.log(Level.SEVERE, null, me);
- } catch(IOException ioe) {
- cmd.setErrorMessage(ioe.getMessage());
-
- if(!handleExceptions) {
- Bugzilla.LOG.log(Level.FINE, null, ioe);
- return;
- }
-
- handleIOException(ioe);
- } catch(RuntimeException re) {
- Throwable t = re.getCause();
- if(t instanceof InterruptedException || !handleExceptions) {
- Bugzilla.LOG.log(Level.FINE, null, t);
- } else {
- Bugzilla.LOG.log(Level.SEVERE, null, re);
- }
- }
- }
-
- /**
- * Returnes true if the given commands status != ok
- * @param cmd
- * @param handleExceptions
- * @return
- * @throws CoreException
- */
- private boolean handleStatus(SynchronizeQueryCommand cmd, boolean handleExceptions) throws CoreException {
- IStatus status = cmd.getStatus();
- if(status == null || status.isOK()) {
- return false;
- }
- Bugzilla.LOG.log(Level.FINE, "command {0} returned status : {1}", new Object[] {cmd, status.getMessage()}); // NOI18N
-
- if (status.getException() instanceof CoreException) {
- throw (CoreException) status.getException();
- }
-
- boolean isHtml = false;
- String errMsg = null;
- if(status instanceof RepositoryStatus) {
- RepositoryStatus rstatus = (RepositoryStatus) status;
- errMsg = rstatus.getHtmlMessage();
- isHtml = errMsg != null;
- }
- if(errMsg == null) {
- errMsg = status.getMessage();
- }
- cmd.setErrorMessage(errMsg);
- cmd.setFailed(true);
-
- if(!handleExceptions) {
- return true;
- }
-
- BugzillaConfiguration conf = repository.getConfiguration();
- if(conf.isValid()) {
- BugzillaVersion version = conf.getInstalledVersion();
- if(version.compareMajorMinorOnly(BugzillaAutoupdate.SUPPORTED_BUGZILLA_VERSION) > 0) {
- notifyErrorMessage(
- NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_ERROR_WARNING", status.getMessage()) + "\n\n" +
- NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_VERSION_WARNING1", version) + "\n" + // NOI18N
- (true ? NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_VERSION_WARNING2") : "")); // NOI18N
- return true;
- }
- }
- if(isHtml) {
- notifyHtmlMessage(errMsg, repository, true);
- } else {
- notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_BUGZILLA_ERROR_WARNING", errMsg)); // NOI18N
- }
- return true;
- }
-
- static void notifyErrorMessage(String msg) {
- if("true".equals(System.getProperty("netbeans.t9y.throwOnClientError", "false"))) { // NOI18N
- Bugzilla.LOG.info(msg);
- throw new AssertionError(msg);
- }
- NotifyDescriptor nd =
- new NotifyDescriptor(
- msg,
- NbBundle.getMessage(BugzillaExecutor.class, "LBLError"), // NOI18N
- NotifyDescriptor.DEFAULT_OPTION,
- NotifyDescriptor.ERROR_MESSAGE,
- new Object[] {NotifyDescriptor.OK_OPTION},
- NotifyDescriptor.OK_OPTION);
- DialogDisplayer.getDefault().notify(nd);
- }
-
- private static boolean notifyHtmlMessage(String html, BugzillaRepository repository, boolean htmlTextIsAllYouGot) throws MissingResourceException {
- if (html != null && !html.trim().equals("")) { // NOI18N
- html = parseHtmlMessage(html, htmlTextIsAllYouGot);
- if(html == null) {
- return false;
- }
- final HtmlPanel p = new HtmlPanel();
- String label = NbBundle.getMessage(
- BugzillaExecutor.class,
- "MSG_ServerResponse", // NOI18N
- new Object[] { repository.getDisplayName() }
- );
- p.setHtml(repository.getUrl(), html, label);
- DialogDescriptor dialogDescriptor =
- new DialogDescriptor(
- p,
- NbBundle.getMessage(BugzillaExecutor.class, "CTL_ServerResponse"), // NOI18N
- true,
- new Object[] { NotifyDescriptor.CANCEL_OPTION },
- NotifyDescriptor.CANCEL_OPTION,
- DialogDescriptor.DEFAULT_ALIGN,
- new HelpCtx(p.getClass()),
- null
- );
- DialogDisplayer.getDefault().notify(dialogDescriptor);
- return true;
- }
- return false;
- }
-
- @SuppressWarnings("empty-statement")
- private static String parseHtmlMessage(String html, boolean htmlTextIsAllYouGot) {
- int idxS = html.indexOf(""); // NOI18N
- if(idxS < 0) {
- return html;
- }
- int idx = idxS;
- int idxE = html.indexOf("
", idx); // NOI18N
- if(!htmlTextIsAllYouGot && idxE < 0) {
- // there is no closing tag and we don't have to relly on the html text
- // as on the only msg we got, so skip parsing
- return null;
- }
-
- int levels = 1;
- while(true) {
- idx = html.indexOf(" idxE) {
- break;
- }
- levels++;
- }
- idxE = idxS;
- for (int i = 0; i < levels; i++) {
- idxE = html.indexOf("
", idxE + 1); // NOI18N
- }
- idxE = idxE > 6 ? idxE + 6 : html.length();
- html = html.substring(idxS, idxE);
-
- // very nice
- html = html.replace("Please press Back and try again.", ""); // NOI18N
-
- return html;
- }
-
- public boolean handleIOException(IOException io) {
- Bugzilla.LOG.log(Level.SEVERE, null, io);
- return true;
- }
-
- @NbBundle.Messages({"MSG_MissingUsername=Missing username."})
- private boolean checkAndEnsureNBCredentials() {
- if( NBBugzillaUtils.isNbRepository(repository.getUrl()) &&
- (repository.getUsername() == null || repository.getUsername().trim().equals("")) )
- {
- boolean ret = repository.authenticate(Bundle.MSG_MissingUsername());
- if(!ret) {
- notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_ActionCanceledByUser")); // NOI18N
- }
- return ret;
- }
- return true;
- }
-
- private abstract static class ExceptionHandler {
-
- protected String errroMsg;
- protected CoreException ce;
- protected BugzillaExecutor executor;
- protected BugzillaRepository repository;
-
- protected ExceptionHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) {
- this.errroMsg = msg;
- this.ce = ce;
- this.executor = executor;
- this.repository = repository;
- }
-
- static ExceptionHandler createHandler(CoreException ce, BugzillaExecutor executor, BugzillaRepository repository, ValidateCommand validateCommand, boolean forRexecute) {
- String errormsg = getLoginError(repository, validateCommand, ce);
- if(errormsg != null) {
- return new LoginHandler(ce, errormsg, executor, repository);
- }
- errormsg = getNotFoundError(ce);
- if(errormsg != null) {
- return new NotFoundHandler(ce, errormsg, executor, repository);
- }
- errormsg = getMidAirColisionError(ce);
- if(errormsg != null) {
- if(forRexecute) {
- return new MidAirHandler(ce, errormsg, executor, repository);
- } else {
- errormsg = MessageFormat.format(errormsg, repository.getDisplayName());
- return new DefaultHandler(ce, errormsg, executor, repository);
- }
- }
- return new DefaultHandler(ce, null, executor, repository);
- }
-
- abstract boolean handle();
-
- boolean reexecuteOnce() {
- return false;
- }
-
- private static String getLoginError(BugzillaRepository repository, ValidateCommand validateCommand, CoreException ce) {
- String msg = getMessage(ce);
- if(msg != null) {
- msg = msg.trim().toLowerCase();
- if(INVALID_USERNAME_OR_PASSWORD.equals(msg) ||
- msg.contains(INVALID_USERNAME_OR_PASSWORD) ||
- msg.contains(EMPTY_PASSWORD) ||
- msg.contains(USERNAME_CONFIRM_MATCH))
- {
- Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N
- String url;
- if(validateCommand != null) {
- url = validateCommand.getUrl();
- } else {
- url = repository.getUrl();
- }
- if(url != null && NBBugzillaUtils.isNbRepository(url)) {
- String user;
- if(validateCommand != null) {
- user = validateCommand.getUser();
- } else {
- user = repository.getUsername();
- }
- if(user != null && user.contains("@")) {
- return NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD") + // NOI18N
- " " + // NOI18N
- NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD_NO_MAIL"); // NOI18N
- }
- }
- return NbBundle.getMessage(BugzillaExecutor.class, "MSG_INVALID_USERNAME_OR_PASSWORD"); // NOI18N
- } else if(msg.startsWith(REPOSITORY_LOGIN_FAILURE) ||
- (msg.startsWith(REPOSITORY) && msg.endsWith(COULD_NOT_BE_FOUND)))
- {
- Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N
- return NbBundle.getMessage(BugzillaExecutor.class, "MSG_UNABLE_LOGIN_TO_REPOSITORY"); // NOI18N
- }
- }
- return null;
- }
-
- private static String getMidAirColisionError(CoreException ce) {
- String msg = getMessage(ce);
- if(msg != null) {
- msg = msg.trim().toLowerCase();
- if(msg.startsWith(MIDAIR_COLLISION)) {
- Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N
- return NbBundle.getMessage(BugzillaExecutor.class, "MSG_MID-AIR_COLLISION"); // NOI18N
- }
- }
- return null;
- }
-
- private static String getNotFoundError(CoreException ce) {
- IStatus status = ce.getStatus();
- Throwable t = status.getException();
- if(t instanceof UnknownHostException ||
- // XXX maybe a different msg ?
- t instanceof SocketTimeoutException ||
- t instanceof NoRouteToHostException ||
- t instanceof ConnectException)
- {
- Bugzilla.LOG.log(Level.FINER, null, t);
- return NbBundle.getMessage(BugzillaExecutor.class, "MSG_HOST_NOT_FOUND"); // NOI18N
- }
- String msg = getMessage(ce);
- if(msg != null) {
- msg = msg.trim().toLowerCase();
- if(HTTP_ERROR_NOT_FOUND.equals(msg)) {
- Bugzilla.LOG.log(Level.FINER, "returned error message [{0}]", msg); // NOI18N
- return NbBundle.getMessage(BugzillaExecutor.class, "MSG_HOST_NOT_FOUND"); // NOI18N
- }
- }
- return null;
- }
-
- static String getMessage(CoreException ce) {
- String msg = ce.getMessage();
- if(msg != null && !msg.trim().equals("")) { // NOI18N
- return msg;
- }
- IStatus status = ce.getStatus();
- msg = status != null ? status.getMessage() : null;
- return msg != null ? msg.trim() : null;
- }
-
- String getMessage() {
- return errroMsg;
- }
-
- private static void notifyError(CoreException ce, BugzillaRepository repository) {
- String msg = getMessage(ce);
- IStatus status = ce.getStatus();
- if (status instanceof BugzillaStatus) {
- BugzillaStatus bs = (BugzillaStatus) status;
- BugzillaUserMatchResponse res = bs.getUserMatchResponse();
-
- if(res != null) {
- String assignedMsg = res.getAssignedToMsg();
- String newCCMsg = res.getNewCCMsg();
- String qaContactMsg = res.getQaContactMsg();
-
- StringBuilder sb = new StringBuilder();
- if(msg != null) {
- sb.append(msg);
- }
- if(assignedMsg != null) {
- sb.append('\n');
- sb.append(assignedMsg);
- }
- if (newCCMsg != null) {
- sb.append('\n');
- sb.append(newCCMsg);
- }
- if (qaContactMsg != null) {
- sb.append('\n');
- sb.append(qaContactMsg);
- }
- msg = sb.toString();
- }
- }
-
- if (msg == null && status instanceof RepositoryStatus) {
- RepositoryStatus rs = (RepositoryStatus) status;
- String html = rs.getHtmlMessage();
- if(notifyHtmlMessage(html, repository, msg == null)) return;
- }
- notifyErrorMessage(msg);
- }
-
- private static class LoginHandler extends ExceptionHandler {
- public LoginHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) {
- super(ce, msg, executor, repository);
- }
- @Override
- String getMessage() {
- return errroMsg;
- }
- @Override
- protected boolean handle() {
- boolean ret = repository.authenticate(errroMsg);
- if(!ret) {
- notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_ActionCanceledByUser")); // NOI18N
- }
- return ret;
- }
- }
-
- private static class MidAirHandler extends ExceptionHandler {
- public MidAirHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) {
- super(ce, msg, executor, repository);
- }
- @Override
- String getMessage() {
- return errroMsg;
- }
- @Override
- protected boolean handle() {
- repository.refreshConfiguration();
- BugzillaConfiguration bc = repository.getConfiguration();
- return bc != null && bc.isValid();
- }
- @Override
- boolean reexecuteOnce() {
- return true;
- }
- }
-
- private static class NotFoundHandler extends ExceptionHandler {
- public NotFoundHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) {
- super(ce, msg, executor, repository);
- }
- @Override
- String getMessage() {
- return errroMsg;
- }
- @Override
- protected boolean handle() {
- Callable c;
- synchronized ( handlerCalls ) {
- final String key = repository.getUrl();
- c = handlerCalls.get(key);
- if(c == null) {
- c = new Callable() {
- private boolean alreadyCalled = false;
- @Override
- public Boolean call() {
- if(alreadyCalled) {
- Bugzilla.LOG.log(Level.INFO, key, ce);
- return false;
- }
- // do not handle this kind of erorr until flag turned false by a succesfull command
- alreadyCalled = true;
- boolean ret = Bugzilla.getInstance().getBugtrackingFactory().editRepository(executor.repository, errroMsg);
- if(!ret) {
- notifyErrorMessage(NbBundle.getMessage(BugzillaExecutor.class, "MSG_ActionCanceledByUser")); // NOI18N
- }
- return ret;
- }
- };
- handlerCalls.put(key, c);
- }
- }
- try {
- return c.call();
- } catch (Exception ex) {
- Exceptions.printStackTrace(ex);
- }
- return false;
- }
- }
- private static class DefaultHandler extends ExceptionHandler {
- public DefaultHandler(CoreException ce, String msg, BugzillaExecutor executor, BugzillaRepository repository) {
- super(ce, msg, executor, repository);
- }
- @Override
- String getMessage() {
- return errroMsg;
- }
- @Override
- protected boolean handle() {
- if(errroMsg != null) {
- notifyErrorMessage(errroMsg);
- } else {
- notifyError(ce, repository);
- }
- return false;
- }
- }
- }
-
- private void checkAutoupdate() {
- try {
- BugzillaAutoupdate.getInstance().checkAndNotify(repository);
- } catch (Throwable t) {
- Bugzilla.LOG.log(Level.SEVERE, "Exception in Bugzilla autoupdate check.", t); // NOI18N
- }
- }
-}
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties
deleted file mode 100644
index 89d8c0ca3987..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/Bundle.properties
+++ /dev/null
@@ -1,36 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-## libs/jsch/manifest.mf
-LBL_Authenticate=Invalid Username or Password
-LBLError=Error
-
-MSG_ActionCanceledByUser = Action canceled by user
-
-CTL_ServerResponse = Server response
-MSG_ServerResponse = The Bugzilla task repository ''{0}'' returned the following response:
-MSG_INVALID_USERNAME_OR_PASSWORD=Invalid Username or Password.
-MSG_INVALID_USERNAME_OR_PASSWORD_NO_MAIL=Do not use email for username.
-NO_URLDISPLAYER_FOUND.=No URLDisplayer found.
-HTMLBROWSER.URLDISPLAYER_FOUND.=HtmlBrowser.URLDisplayer found.
-MSG_HOST_NOT_FOUND=Host not found
-MSG_MID-AIR_COLLISION=Mid-air collision occurred while submitting to ''{0}''.\nRefresh the task and re-submit changes.
-MSG_UNABLE_LOGIN_TO_REPOSITORY=Unable login to repository.
-MSG_BUGZILLA_VERSION_WARNING1=The installed Bugzilla plugin does not support Bugzilla {0}.
-MSG_BUGZILLA_VERSION_WARNING2=You can use the Plugin manager to update the plugin from the Update Center.
-MSG_BUGZILLA_ERROR_WARNING=The following error was returned:\n\n{0}
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java
deleted file mode 100644
index bda8c394bf3b..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetAttachmentCommand.java
+++ /dev/null
@@ -1,69 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.commands;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.net.MalformedURLException;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugzilla.util.FileUtils;
-import org.netbeans.modules.mylyn.util.BugtrackingCommand;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class GetAttachmentCommand extends BugtrackingCommand {
- private BugzillaRepository repository;
- private final String id;
- private final OutputStream os;
- private String stringValue;
-
- public GetAttachmentCommand(BugzillaRepository repository, String id, OutputStream os) {
- this.repository = repository;
- this.id = id;
- this.os = os;
- }
-
- @Override
- public void execute() throws CoreException, IOException, MalformedURLException {
- InputStream is = Bugzilla.getInstance().getClient(repository).getAttachmentData(id, new NullProgressMonitor());
- FileUtils.copyStream(is, os);
- }
-
- @Override
- public String toString() {
- if(stringValue == null) {
- StringBuilder sb = new StringBuilder();
- sb.append("GetAttachmentCommand [repository="); // NOI18N
- sb.append(repository.getUrl());
- sb.append(",attachmentID="); // NOI18N
- sb.append(id);
- sb.append("]"); // NOI18N
- stringValue = sb.toString();
- }
- return stringValue;
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java
deleted file mode 100644
index 4dea45383a33..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/GetConfigurationCommand.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.commands;
-
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.mylyn.util.BugtrackingCommand;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class GetConfigurationCommand extends BugtrackingCommand {
-
- private final boolean forceRefresh;
- private BugzillaRepository repository;
- private RepositoryConfiguration conf;
-
- public GetConfigurationCommand(boolean forceRefresh, BugzillaRepository repository) {
- this.forceRefresh = forceRefresh;
- this.repository = repository;
- }
-
- @Override
- public void execute() throws CoreException, IOException, MalformedURLException {
- boolean refresh = forceRefresh;
- String b = System.getProperty("org.netbeans.modules.bugzilla.persistentRepositoryConfiguration", "false"); // NOI18N
- if("true".equals(b)) { // NOI18N
- refresh = true;
- }
- Bugzilla.LOG.log(Level.FINE, " Refresh bugzilla configuration [{0}, forceRefresh={1}]", new Object[]{repository.getUrl(), refresh}); // NOI18N
- conf = Bugzilla.getInstance().getRepositoryConfiguration(repository, refresh);
- }
-
- public RepositoryConfiguration getConf() {
- return hasFailed() ? null : conf;
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("GetConfigurationCommand [repository="); // NOI18N
- sb.append(repository.getUrl());
- sb.append("]"); // NOI18N
- return sb.toString();
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form
deleted file mode 100644
index ebce4a88a64c..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.form
+++ /dev/null
@@ -1,89 +0,0 @@
-
-
-
-
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java
deleted file mode 100644
index ceb3a8dce1af..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/HtmlPanel.java
+++ /dev/null
@@ -1,117 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.commands;
-
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.logging.Level;
-import javax.swing.event.HyperlinkEvent;
-import javax.swing.event.HyperlinkListener;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.openide.awt.HtmlBrowser;
-import org.openide.util.NbBundle;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class HtmlPanel extends javax.swing.JPanel {
-
- /** Creates new form HtmlPanel */
- public HtmlPanel() {
- initComponents();
- }
-
- void setHtml(final String baseUrl, String html, String label) {
- pane.setText(html);
- pane.addHyperlinkListener(new HyperlinkListener() {
- public void hyperlinkUpdate(HyperlinkEvent e) {
- if(e.getEventType() != HyperlinkEvent.EventType.ACTIVATED) return;
- String desc = e.getDescription();
- URL url = null;
- try {
- url = new URL(baseUrl + "/" + desc); // NOI18N
- } catch (MalformedURLException mue) {
- Bugzilla.LOG.log(Level.WARNING, null, mue);
- return;
- }
- HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault ();
- assert displayer != null : NbBundle.getMessage(HtmlPanel.class, "HTMLBROWSER.URLDISPLAYER_FOUND."); // NOI18N
- if (displayer != null) {
- displayer.showURL(url);
- } else {
- Bugzilla.LOG.info(NbBundle.getMessage(HtmlPanel.class, "NO_URLDISPLAYER_FOUND.")); // NOI18N
- }
- }
- });
- this.label.setText(label);
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // //GEN-BEGIN:initComponents
- private void initComponents() {
-
- jScrollPane1 = new javax.swing.JScrollPane();
- pane = new javax.swing.JTextPane();
- label = new javax.swing.JLabel();
-
- pane.setContentType("text/html");
- pane.setEditable(false);
- jScrollPane1.setViewportView(pane);
-
- label.setText(org.openide.util.NbBundle.getMessage(HtmlPanel.class, "MSG_ServerResponse")); // NOI18N
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(label)
- .addGap(0, 173, Short.MAX_VALUE))
- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 575, Short.MAX_VALUE))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addComponent(label)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jScrollPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 377, Short.MAX_VALUE)
- .addContainerGap())
- );
- }// //GEN-END:initComponents
-
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JScrollPane jScrollPane1;
- private javax.swing.JLabel label;
- private javax.swing.JTextPane pane;
- // End of variables declaration//GEN-END:variables
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java
deleted file mode 100644
index 009722a554b1..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/commands/ValidateCommand.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.commands;
-
-import java.io.IOException;
-import java.util.logging.Level;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
-import org.eclipse.mylyn.commons.net.AuthenticationType;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaClient;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.netbeans.modules.team.commons.LogUtils;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.mylyn.util.BugtrackingCommand;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class ValidateCommand extends BugtrackingCommand {
-
- private final TaskRepository taskRepository;
-
- public ValidateCommand(TaskRepository taskRepository) {
- this.taskRepository = taskRepository;
- }
-
- @Override
- public void execute() throws CoreException {
- log();
- try {
- BugzillaClient client = Bugzilla.getInstance().getRepositoryConnector().getClientManager().getClient(taskRepository, new NullProgressMonitor());
- client.validate(new NullProgressMonitor());
- } catch (IOException ex) {
- Bugzilla.LOG.log(Level.SEVERE, null, ex); // XXX handle errors
- }
- }
-
- @Override
- public String toString() {
- StringBuilder sb = new StringBuilder();
- sb.append("ValidateCommand [repository="); // NOI18N
- sb.append(taskRepository.getUrl());
- sb.append("]"); // NOI18N
- return sb.toString();
- }
-
- String getUrl() {
- return taskRepository.getUrl();
- }
-
- String getUser() {
- return taskRepository.getCredentials(AuthenticationType.REPOSITORY).getUserName();
- }
-
- private void log() {
- Bugzilla.LOG.log(
- Level.INFO,
- "validating [{0},{1},{2},{3}]", // NOI18N
- new Object[]{
- taskRepository.getUrl(),
- getCredentialsString(taskRepository.getCredentials(AuthenticationType.REPOSITORY)),
- getCredentialsString(taskRepository.getCredentials(AuthenticationType.HTTP)),
- getCredentialsString(taskRepository.getCredentials(AuthenticationType.PROXY))});
- }
-
- private String getCredentialsString(AuthenticationCredentials c) {
- if(c == null) {
- return "null, null"; // NOI18N
- }
- return c.getUserName() + "," + LogUtils.getPasswordLog(c.getPassword().toCharArray()); // NOI18N
- }
-
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java
deleted file mode 100644
index c7099139cb38..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/AttachmentHyperlinkSupport.java
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.issue;
-
-import java.util.Collection;
-
-/**
- * Determines boundaries of text that should be rendered as a hyperlink
- * to an issue attachment (screenshot, full thread-dump, app. output etc.).
- *
- * @author Marian Petras
- */
-class AttachmentHyperlinkSupport {
-
- private static final String PREFIX = "Created an attachment (id="; //NOI18N
- private static final String PREFIX2 = "Created attachment "; //NOI18N
- private static final int EQUAL_SIGN_POSITION = PREFIX.lastIndexOf('=');
- private static final int ATTACHMENT_HYPERLINK_START_FALLBACK = PREFIX.indexOf("attachment"); //NOI18N
- private static final int ATTACHMENT_HYPERLINK_START_FALLBACK2 = PREFIX2.indexOf("attachment"); //NOI18N
- //private static final Pattern pattern = Pattern.compile(
- // "([0-9]++)\\)[^\\r\\n]*+(?:[\\r\\n]++(.*+))?+"); //NOI18N
-
- private static final char CR = '\r';
- private static final char LF = '\n';
-
- static Attachement findAttachment(String text, Collection knownIds) {
- int[] boundaries = findAttachment1(text, knownIds);
- if(boundaries == null) {
- return findAttachment2(text, knownIds);
- } else {
- Attachement b = new Attachement();
- b.idx1 = boundaries[0];
- b.idx2 = boundaries[1];
- b.id = getAttachmentId(text);
- return b;
- }
- }
-
- private static int[] findAttachment1(String text, Collection knownIds) {
- if ((knownIds != null) && knownIds.isEmpty()) {
- return null;
- }
-
- final int length = text.length();
- if ((length >= EQUAL_SIGN_POSITION + 3)
- && (text.charAt(EQUAL_SIGN_POSITION) == '=')
- && text.startsWith(PREFIX)) {
- int idStartIndex = EQUAL_SIGN_POSITION + 1;
- if (isValidIdChar(text.charAt(idStartIndex))) {
- int index = idStartIndex + 1;
- while ((index < length) && isValidIdChar(text.charAt(index))) {
- index++;
- }
- if ((index < length) && (text.charAt(index) == ')')) {
- int idEndIndex = index;
- if (isKnownId(text.substring(idStartIndex, idEndIndex),
- knownIds)) {
- return findBoundaries(index, text, idEndIndex + 1, ATTACHMENT_HYPERLINK_START_FALLBACK);
- }
- }
- }
- }
- return null;
- }
-
- private static Attachement findAttachment2(String text, Collection knownIds) {
- if (knownIds == null || knownIds.isEmpty()) {
- return null;
- }
-
- for (String id : knownIds) {
- String prefixId = PREFIX2 + id;
- if(!text.startsWith(prefixId)) {
- continue;
- }
-
- int[] boundaries = findBoundaries(prefixId.length() - 1, text, prefixId.length(), ATTACHMENT_HYPERLINK_START_FALLBACK2);
- if(boundaries != null) {
- Attachement b = new Attachement();
- b.idx1 = boundaries[0];
- b.idx2 = boundaries[1];
- b.id = id;
- return b;
- }
- }
- return null;
- }
-
- private static int[] findBoundaries(int index, String text, int idEndIndex, int fallback) {
- final int length = text.length();
- do {
- index++;
- } while ((index < length) && isNotNewline(text.charAt(index)));
- if (index < length) { //at newline
-
- /* skip just one newline */
- if (text.charAt(index) == CR) {
- index++;
- }
- if ((index < length) && (text.charAt(index) == LF)) {
- index++;
- }
- while ((index < length) && isSpace(text.charAt(index))) {
- index++;
- }
- if ((index < length) && isNotNewline(text.charAt(index))) { //at printable
- int descriptionStart = index;
- do {
- index++;
- } while ((index < length) && isNotNewline(text.charAt(index)));
- return new int[] {descriptionStart, index};
- }
- }
- return new int[] {fallback, idEndIndex};
- }
-
- private static String getAttachmentId(String commentText) {
- int closingBracketPos = commentText.indexOf(')', PREFIX.length() + 1);
- assert closingBracketPos != -1;
- return new String(commentText.substring(PREFIX.length(), closingBracketPos));
- }
-
- static class Attachement {
- int idx1;
- int idx2;
- String id;
- }
-
- private static boolean isKnownId(String id,
- Collection knownIds) {
- if (knownIds == null) {
- return true;
- }
-
- for (String validId : knownIds) {
- if (id.equals(validId)) {
- return true;
- }
- }
- return false;
- }
-
- private static boolean isValidIdChar(char c) {
- return (c >= '0') && (c <= '9');
- }
-
- private static boolean isNotNewline(char c) {
- return (c != '\r') && (c != '\n');
- }
-
- private static boolean isSpace(char c) {
- return (c == ' ') || (c == '\t');
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java
deleted file mode 100644
index f09426c79b44..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssue.java
+++ /dev/null
@@ -1,1694 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.issue;
-
-import java.awt.EventQueue;
-import java.io.File;
-import java.io.OutputStream;
-import java.lang.ref.WeakReference;
-import java.net.URL;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Date;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Properties;
-import java.util.ResourceBundle;
-import java.util.logging.Level;
-import javax.swing.JTable;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaAttribute;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaOperation;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaTaskDataHandler;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
-import org.eclipse.mylyn.internal.tasks.core.data.FileTaskAttachmentSource;
-import org.eclipse.mylyn.tasks.core.RepositoryResponse;
-import org.eclipse.mylyn.tasks.core.data.TaskAttribute;
-import org.eclipse.mylyn.tasks.core.data.TaskAttributeMapper;
-import org.eclipse.mylyn.tasks.core.data.TaskData;
-import org.eclipse.mylyn.tasks.core.data.TaskOperation;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugtracking.issuetable.IssueNode;
-import org.netbeans.modules.bugtracking.spi.IssueController;
-import org.netbeans.modules.bugtracking.issuetable.ColumnDescriptor;
-import org.netbeans.modules.bugtracking.spi.IssueScheduleInfo;
-import org.netbeans.modules.team.spi.OwnerInfo;
-import org.netbeans.modules.bugtracking.commons.AttachmentsPanel;
-import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils;
-import org.netbeans.modules.bugtracking.commons.UIUtils;
-import org.netbeans.modules.bugzilla.BugzillaConfig;
-import org.netbeans.modules.bugzilla.commands.AddAttachmentCommand;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugzilla.commands.GetAttachmentCommand;
-import org.netbeans.modules.bugzilla.repository.IssueField;
-import org.openide.filesystems.FileUtil;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.netbeans.modules.bugzilla.util.NbBugzillaConstants;
-import org.netbeans.modules.mylyn.util.AbstractNbTaskWrapper;
-import org.netbeans.modules.mylyn.util.MylynSupport;
-import org.netbeans.modules.mylyn.util.NbTask;
-import org.netbeans.modules.mylyn.util.NbTask.SynchronizationState;
-import org.netbeans.modules.mylyn.util.NbTaskDataModel;
-import org.netbeans.modules.mylyn.util.NbTaskDataModel.NbTaskDataModelEvent;
-import org.netbeans.modules.mylyn.util.NbTaskDataState;
-import org.netbeans.modules.mylyn.util.commands.SubmitTaskCommand;
-import org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand;
-import org.openide.awt.StatusDisplayer;
-import org.openide.modules.Places;
-import org.openide.util.NbBundle;
-import static org.netbeans.modules.bugzilla.issue.Bundle.*;
-
-/**
- *
- * @author Tomas Stupka
- * @author Jan Stola
- */
-public class BugzillaIssue extends AbstractNbTaskWrapper {
-
- public static final String RESOLVE_FIXED = "FIXED"; // NOI18N
- public static final String RESOLVE_DUPLICATE = "DUPLICATE"; // NOI18N
- public static final String VCSHOOK_BUGZILLA_FIELD = "netbeans.vcshook.bugzilla."; // NOI18N
- private static final SimpleDateFormat CC_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // NOI18N
- static final SimpleDateFormat DUE_DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd"); // NOI18N
-
- private final BugzillaRepository repository;
-
- private BugzillaIssueController controller;
- private WeakReference nodeRef;
- private OwnerInfo info;
-
- static final String LABEL_NAME_ID = "bugzilla.issue.id"; // NOI18N
- static final String LABEL_NAME_SEVERITY = "bugzilla.issue.severity"; // NOI18N
- static final String LABEL_NAME_ISSUE_TYPE = "bugzilla.issue.issue_type"; // NOI18N
- static final String LABEL_NAME_PRIORITY = "bugzilla.issue.priority"; // NOI18N
- static final String LABEL_NAME_STATUS = "bugzilla.issue.status"; // NOI18N
- static final String LABEL_NAME_RESOLUTION = "bugzilla.issue.resolution"; // NOI18N
- static final String LABEL_NAME_ASSIGNED_TO = "bugzilla.issue.assigned"; // NOI18N
- static final String LABEL_NAME_PRODUCT = "bugzilla.issue.product"; // NOI18N
- static final String LABEL_NAME_COMPONENT = "bugzilla.issue.component"; // NOI18N
- static final String LABEL_NAME_VERSION = "bugzilla.issue.version"; // NOI18N
- static final String LABEL_NAME_OS = "bugzilla.issue.os"; // NOI18N
- static final String LABEL_NAME_PLATFORM = "bugzilla.issue.platform"; // NOI18N
- static final String LABEL_NAME_MILESTONE = "bugzilla.issue.milestone"; // NOI18N
- static final String LABEL_NAME_REPORTER = "bugzilla.issue.reporter"; // NOI18N
- static final String LABEL_NAME_MODIFICATION = "bugzilla.issue.modified"; // NOI18N
- static final String LABEL_NAME_QA_CONTACT = "bugzilla.issue.qa_contact"; // NOI18N
- static final String LABEL_NAME_KEYWORDS = "bugzilla.issue.keywords"; // NOI18N
- static final String LABEL_NAME_WHITEBOARD = "bugzilla.issue.whiteboard"; // NOI18N
-
- /**
- * IssueProvider wasn't seen yet
- */
- static final int FIELD_STATUS_IRELEVANT = -1;
-
- /**
- * Field wasn't changed since the issue was seen the last time
- */
- static final int FIELD_STATUS_UPTODATE = 1;
-
- /**
- * Field was changed since the issue was seen the last time
- */
- static final int FIELD_STATUS_MODIFIED = 2;
-
- /**
- * Field was changed since the issue was seen the last time
- */
- static final int FIELD_STATUS_OUTGOING = 4;
-
- /**
- * Field was changed both locally and in repository
- */
- static final int FIELD_STATUS_CONFLICT = FIELD_STATUS_MODIFIED | FIELD_STATUS_OUTGOING;
- private String initialProduct = null;
-
- private Map availableOperations;
-
- private String recentChanges = "";
- private String tooltip = "";
-
- private static final URL ICON_REMOTE_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/remote.png"); //NOI18N
- private static final URL ICON_CONFLICT_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/conflict.png"); //NOI18N
- private static final URL ICON_UNSUBMITTED_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/unsubmitted.png"); //NOI18N
- private boolean loading;
- private boolean wasDuplicated;
-
- public BugzillaIssue (NbTask task, BugzillaRepository repo) {
- super(task);
- this.repository = repo;
- updateRecentChanges();
- updateTooltip();
- }
-
- @Override
- protected void taskDeleted (NbTask task) {
- getRepository().taskDeleted(getID(task));
- }
-
- void markUserChange () {
- if (isMarkedNewUnread()) {
- markNewRead();
- }
- }
-
- void delete () {
- deleteTask();
- }
-
- public void opened() {
- if(Bugzilla.LOG.isLoggable(Level.FINE)) {
- Bugzilla.LOG.log(Level.FINE, "issue {0} open start", new Object[] {getID()});
- }
- loading = true;
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run () {
- if (editorOpened()) {
- ensureConfigurationUptodate();
- loading = false;
- refreshViewData(true);
- } else {
- // should close somehow
- }
- }
- });
- String refresh = System.getProperty("org.netbeans.modules.bugzilla.noIssueRefresh"); // NOI18N
- if(refresh != null && refresh.equals("true")) { // NOI18N
- return;
- }
- if(Bugzilla.LOG.isLoggable(Level.FINE)) {
- Bugzilla.LOG.log(Level.FINE, "issue {0} open finish", new Object[] {getID()});
- }
- }
-
- public void closed () {
- if(Bugzilla.LOG.isLoggable(Level.FINE)) {
- Bugzilla.LOG.log(Level.FINE, "issue {0} close start", new Object[] {getID()});
- }
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run () {
- editorClosed();
- }
- });
- if(Bugzilla.LOG.isLoggable(Level.FINE)) {
- Bugzilla.LOG.log(Level.FINE, "issue {0} close finish", new Object[] {getID()});
- }
- }
-
- public String getDisplayName() {
- return getDisplayName(getNbTask());
- }
-
- public static String getDisplayName (NbTask task) {
- return task.getSynchronizationState() == SynchronizationState.OUTGOING_NEW ?
- task.getSummary() :
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue", new Object[] {getID(task), task.getSummary()}); //NOI18N
- }
-
- // XXX not the same as in Issue.getShortenedDisplayName()
-
-// public String getShortenedDisplayName() {
-// if (data.isNew()) {
-// return getDisplayName();
-// }
-//
-// String shortSummary = TextUtils.shortenText(getSummary(),
-// 2, //try at least 2 words
-// SHORTENED_SUMMARY_LENGTH);
-// return NbBundle.getMessage(BugzillaIssue.class,
-// "CTL_Issue", //NOI18N
-// new Object[] {getID(), shortSummary});
-// }
-
- public String getTooltip() {
- return tooltip;
- }
-
- public static ColumnDescriptor[] getColumnDescriptors(BugzillaRepository repository) {
- ResourceBundle loc = NbBundle.getBundle(BugzillaIssue.class);
- JTable t = new JTable();
- List> ret = new LinkedList<>();
-
- ret.add(new ColumnDescriptor<>(LABEL_NAME_ID, String.class,
- loc.getString("CTL_Issue_ID_Title"), // NOI18N
- loc.getString("CTL_Issue_ID_Desc"), // NOI18N
- UIUtils.getColumnWidthInPixels(6, t)));
- ret.add(new ColumnDescriptor<>(IssueNode.LABEL_NAME_SUMMARY, String.class,
- loc.getString("CTL_Issue_Summary_Title"), // NOI18N
- loc.getString("CTL_Issue_Summary_Desc"))); // NOI18N
- ret.add(NBBugzillaUtils.isNbRepository(repository.getUrl())
- ?
- new ColumnDescriptor<>(LABEL_NAME_ISSUE_TYPE, String.class,
- loc.getString("CTL_Issue_Issue_Type_Title"), // NOI18N
- loc.getString("CTL_Issue_Issue_Type_Desc"), // NOI18N
- 0)
- :
- new ColumnDescriptor<>(LABEL_NAME_SEVERITY, String.class,
- loc.getString("CTL_Issue_Severity_Title"), // NOI18N
- loc.getString("CTL_Issue_Severity_Desc"), // NOI18N
- 0));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_PRIORITY, String.class,
- loc.getString("CTL_Issue_Priority_Title"), // NOI18N
- loc.getString("CTL_Issue_Priority_Desc"), // NOI18N
- 0));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_STATUS, String.class,
- loc.getString("CTL_Issue_Status_Title"), // NOI18N
- loc.getString("CTL_Issue_Status_Desc"), // NOI18N
- 0));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_RESOLUTION, String.class,
- loc.getString("CTL_Issue_Resolution_Title"), // NOI18N
- loc.getString("CTL_Issue_Resolution_Desc"), // NOI18N
- 0));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_ASSIGNED_TO, String.class,
- loc.getString("CTL_Issue_Assigned_Title"), // NOI18N
- loc.getString("CTL_Issue_Assigned_Desc"), // NOI18N
- 0));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_PRODUCT, String.class,
- loc.getString("CTL_Issue_Product_Title"), // NOI18N
- loc.getString("CTL_Issue_Product_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_COMPONENT, String.class,
- loc.getString("CTL_Issue_Component_Title"), // NOI18N
- loc.getString("CTL_Issue_Component_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_VERSION, String.class,
- loc.getString("CTL_Issue_Version_Title"), // NOI18N
- loc.getString("CTL_Issue_Version_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_OS, String.class,
- loc.getString("CTL_Issue_OS_Title"), // NOI18N
- loc.getString("CTL_Issue_OS_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_PLATFORM, String.class,
- loc.getString("CTL_Issue_Platform_Title"), // NOI18N
- loc.getString("CTL_Issue_Platform_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_MILESTONE, String.class,
- loc.getString("CTL_Issue_Milestone_Title"), // NOI18N
- loc.getString("CTL_Issue_Milestone_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_REPORTER, String.class,
- loc.getString("CTL_Issue_Reporter_Title"), // NOI18N
- loc.getString("CTL_Issue_Reporter_Desc"), // NOI18N
- 0, false));
- ret.add(new ColumnDescriptor<>(LABEL_NAME_MODIFICATION, String.class,
- loc.getString("CTL_Issue_Modification_Title"), // NOI18N
- loc.getString("CTL_Issue_Modification_Desc"), // NOI18N
- 0, false));
- if(BugzillaUtil.showQAContact(repository)) {
- ret.add(new ColumnDescriptor<>(LABEL_NAME_QA_CONTACT, String.class,
- loc.getString("CTL_Issue_QA_Contact_Title"), // NOI18N
- loc.getString("CTL_Issue_QA_Contact_Desc"), // NOI18N
- 0, false));
- }
- ret.add(new ColumnDescriptor<>(LABEL_NAME_KEYWORDS, String.class,
- loc.getString("CTL_Issue_Keywords_Title"), // NOI18N
- loc.getString("CTL_Issue_Keywords_Desc"), // NOI18N
- 0, false));
- if(BugzillaUtil.showStatusWhiteboard(repository)) {
- ret.add(new ColumnDescriptor<>(LABEL_NAME_WHITEBOARD, String.class,
- loc.getString("CTL_Issue_Whiteboard_Title"), // NOI18N
- loc.getString("CTL_Issue_Whiteboard_Desc"), // NOI18N
- 0, false));
- }
- return ret.toArray(new ColumnDescriptor[0]);
- }
-
-
- public IssueController getController() {
- if (controller == null) {
- controller = new BugzillaIssueController(this);
- }
- return controller;
- }
-
- @Override
- public String toString() {
- String str = getID() + " : " + getSummary(); // NOI18N
- return str;
- }
-
- public IssueNode getNode() {
- BugzillaIssueNode n = nodeRef != null ? nodeRef.get() : null;
- if(n == null) {
- n = createNode();
- nodeRef = new WeakReference<>(n);
- }
- if (!EventQueue.isDispatchThread()) {
- // loads repository task data from disk
- getRepositoryTaskData();
- }
- return n;
- }
-
- public void setOwnerInfo(OwnerInfo info) {
- this.info = info;
- }
-
- public OwnerInfo getOwnerInfo() {
- return info;
- }
-
- public String getRecentChanges() {
- return recentChanges;
- }
-
- public BugzillaRepository getRepository() {
- return repository;
- }
-
- private void ensureConfigurationUptodate () {
- BugzillaConfiguration conf = getRepository().getConfiguration();
- NbTaskDataState taskDataState = null;
- try {
- taskDataState = getNbTask().getTaskDataState();
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.INFO, null, ex);
- }
- boolean needsRefresh = false;
- if (taskDataState != null && !isNew()) {
- for (TaskData taskData : new TaskData[] {
- taskDataState.getLastReadData(),
- taskDataState.getLocalData(),
- taskDataState.getRepositoryData()
- }) {
- String product = getFieldValue(taskData, IssueField.PRODUCT);
- String resolution = getFieldValue(taskData, IssueField.RESOLUTION);
- String severity = getFieldValue(taskData, IssueField.SEVERITY);
- String milestone = getFieldValue(taskData, IssueField.MILESTONE);
- String version = getFieldValue(taskData, IssueField.VERSION);
- String priority = getFieldValue(taskData, IssueField.PRIORITY);
- String platform = getFieldValue(taskData, IssueField.PLATFORM);
- String status = getFieldValue(taskData, IssueField.STATUS);
- String os = getFieldValue(taskData, IssueField.OS);
- String component = getFieldValue(taskData, IssueField.COMPONENT);
-
- if(!component.isEmpty() && !conf.getComponents(product).contains(component) ||
- !os.isEmpty() && !conf.getOSs().contains(os) ||
- !status.isEmpty() && !conf.getStatusValues().contains(status) ||
- !platform.isEmpty() && !conf.getPlatforms().contains(platform) ||
- !priority.isEmpty() && !conf.getPriorities().contains(priority) ||
- !product.isEmpty() && !conf.getProducts().contains(product) ||
- !resolution.isEmpty() && !conf.getResolutions().contains(resolution) ||
- !severity.isEmpty() && !conf.getSeverities().contains(severity) ||
- !milestone.isEmpty() && !conf.getTargetMilestones(product).contains(milestone) ||
- !version.isEmpty() && !conf.getVersions(product).contains(version))
- {
- needsRefresh = true;
- break;
- }
- }
- }
- if (needsRefresh) {
- getRepository().refreshConfiguration();
-
- }
- }
-
- @Override
- protected void repositoryTaskDataLoaded (TaskData repositoryTaskData) {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run () {
- if (updateTooltip()) {
- fireDataChanged();
- }
- }
- });
- }
-
- public String getRepositoryFieldValue (IssueField f) {
- NbTaskDataModel m = getModel();
- TaskData td;
- if (m == null) {
- td = getRepositoryTaskData();
- if (td == null) {
- return "..."; //NOI18N
- }
- } else {
- td = m.getRepositoryTaskData();
- }
- return getFieldValue(td, f);
- }
-
- public String getFieldValue(IssueField f) {
- NbTaskDataModel m = getModel();
- return getFieldValue(m == null ? null : m.getLocalTaskData(), f);
- }
-
- String getLastSeenFieldValue (IssueField f) {
- NbTaskDataModel m = getModel();
- return getFieldValue(m == null ? null : m.getLastReadTaskData(), f);
- }
-
- private static String getFieldValue (TaskData taskData, IssueField f) {
- if (taskData == null) {
- return "";
- }
- if(f.isSingleAttribute()) {
- TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey());
- if(a != null && a.getValues().size() > 1) {
- return listValues(a);
- }
- return a != null ? a.getValue() : ""; // NOI18N
- } else {
- List attrs = taskData.getAttributeMapper().getAttributesByType(taskData, f.getKey());
- // returning 0 would set status MODIFIED instead of NEW
- return "" + ( attrs != null && attrs.size() > 0 ? attrs.size() : ""); // NOI18N
- }
- }
-
- /**
- * Returns a comma separated list created
- * from the values returned by TaskAttribute.getValues()
- *
- * @param a
- * @return
- */
- private static String listValues(TaskAttribute a) {
- if(a == null) {
- return ""; // NOI18N
- }
- StringBuilder sb = new StringBuilder();
- List l = a.getValues();
- for (int i = 0; i < l.size(); i++) {
- String s = l.get(i);
- sb.append(s);
- if(i < l.size() -1) {
- sb.append(","); // NOI18N
- }
- }
- return sb.toString();
- }
-
- void setFieldValue(IssueField f, String value) {
- if(f.isReadOnly()) {
- assert false : "can't set value into IssueField " + f.getKey(); // NOI18N
- return;
- }
- NbTaskDataModel m = getModel();
- // should not happen, setFieldValue either runs with model lock
- // or it is called from issue editor in AWT - the editor could not be closed by user in the meantime
- // (or it could. see issue #254373 -> reload attributes called setFV)
- boolean isshowing = getController().getComponent().isShowing();
- assert m != null || !isshowing : "isShowing=" + isshowing + ", model=" + m;
- if(m != null) {
- TaskData taskData = m.getLocalTaskData();
- TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey());
- if (a == null) {
- if (f == IssueField.REASSIGN_TO_DEFAULT) {
- setOperation(BugzillaOperation.reassignbycomponent);
- return;
- }
- a = new TaskAttribute(taskData.getRoot(), f.getKey());
- }
- if(f == IssueField.PRODUCT) {
- handleProductChange(a);
- }
- Bugzilla.LOG.log(Level.FINER, "setting value [{0}] on field [{1}]", new Object[]{value, f.getKey()}) ;
- if (!value.equals(a.getValue())) {
- setValue(m, a, value);
- }
- }
- }
-
- void setFieldValues(IssueField f, List ccs) {
- NbTaskDataModel m = getModel();
- // should not happen, setFieldValue either runs with model lock
- // or it is called from issue editor in AWT - the editor could not be closed by user in the meantime
- // (or it could. see issue #254373 -> reload attributes called setFV)
- assert m != null || !getController().getComponent().isShowing();
- if(m != null) {
- TaskData taskData = m.getLocalTaskData();
- TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey());
- if(a == null) {
- a = new TaskAttribute(taskData.getRoot(), f.getKey());
- }
- a.setValues(ccs);
- m.attributeChanged(a);
- }
- }
-
- public List getRepositoryFieldValues (IssueField f) {
- NbTaskDataModel m = getModel();
- return getFieldValues(m == null ? getRepositoryTaskData() : m.getRepositoryTaskData(), f);
- }
-
- public List getFieldValues(IssueField f) {
- NbTaskDataModel m = getModel();
- return getFieldValues(m == null ? null : m.getLocalTaskData(), f);
- }
-
- List getLastSeenFieldValues (IssueField f) {
- NbTaskDataModel m = getModel();
- return getFieldValues(m == null ? null : m.getLastReadTaskData(), f);
- }
-
- private static List getFieldValues(TaskData taskData, IssueField f) {
- if (taskData == null) {
- return Collections.emptyList();
- }
- if(f.isSingleAttribute()) {
- TaskAttribute a = taskData.getRoot().getMappedAttribute(f.getKey());
- if(a != null) {
- return a.getValues();
- } else {
- return Collections.emptyList();
- }
- } else {
- List ret = new ArrayList<>();
- ret.add(getFieldValue(taskData, f));
- return ret;
- }
- }
-
- /**
- * Returns a status value for the given field
- *
- * {@link #FIELD_STATUS_IRELEVANT} - issue wasn't seen yet
- * {@link #FIELD_STATUS_UPTODATE} - field value wasn't changed
- * {@link #FIELD_STATUS_MODIFIED} - field value was changed in repository
- * {@link #FIELD_STATUS_OUTGOING} - field value was changed locally
- * {@link #FIELD_STATUS_CONFLICT} - field value was changed both locally and remotely
- *
- * @param f IssueField
- * @return a status value
- */
- public int getFieldStatus(IssueField f) {
- NbTaskDataModel m = getModel();
- if (m == null) {
- return FIELD_STATUS_UPTODATE;
- }
- TaskAttribute ta = m.getLocalTaskData().getRoot().getMappedAttribute(f.getKey());
- boolean incoming = ta != null && m.hasIncomingChanges(ta, true);
- boolean outgoing = ta != null && m.hasOutgoingChanges(ta);
- if (ta == null) {
- return FIELD_STATUS_UPTODATE;
- } else if (incoming & outgoing) {
- return FIELD_STATUS_CONFLICT;
- } else if (incoming) {
- return FIELD_STATUS_MODIFIED;
- } else if (outgoing) {
- return FIELD_STATUS_OUTGOING;
- }
- return FIELD_STATUS_UPTODATE;
- }
-
- private BugzillaIssueNode createNode() {
- return new BugzillaIssueNode(this);
- }
-
- private void handleProductChange(TaskAttribute a) {
- if(!isNew() && initialProduct == null) {
- initialProduct = a.getValue();
- }
- }
-
- public void resolve (final String resolution) {
- assert !isNew();
-
- runWithModelLoaded(new Runnable() {
- @Override
- public void run () {
- String value = getFieldValue(IssueField.STATUS);
- if(!(value.equals("RESOLVED") && resolution.equals(getFieldValue(IssueField.RESOLUTION)))) { // NOI18N
- setOperation(BugzillaOperation.resolve);
- TaskAttribute rta = getModel().getLocalTaskData().getRoot();
- TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.resolve.getInputId());
- if(ta != null) { // ta can be null when changing status from CLOSED to RESOLVED
- setValue(getModel(), ta, resolution);
- }
- }
- }
- });
- }
-
- void accept() {
- setOperation(BugzillaOperation.accept);
- }
-
- void duplicate(String id) {
- NbTaskDataModel m = getModel();
- setOperation(BugzillaOperation.duplicate);
- TaskAttribute rta = m.getLocalTaskData().getRoot();
- TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.duplicate.getInputId());
- setValue(m, ta, id);
- wasDuplicated = true;
- }
-
- boolean canReassign() {
- NbTaskDataModel m = getModel();
- if (m == null) {
- return false;
- }
- BugzillaConfiguration rc = getRepository().getConfiguration();
- final BugzillaVersion installedVersion = rc != null ? rc.getInstalledVersion() : null;
- boolean oldRepository = installedVersion != null ? installedVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) < 0 : false;
- if (oldRepository) {
- TaskAttribute rta = m.getLocalTaskData().getRoot();
- TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.reassign.getInputId());
- return (ta != null);
- } else {
- return true;
- }
- }
-
- boolean canAssignToDefault() {
- NbTaskDataModel m = getModel();
- if (m == null) {
- return false;
- }
- BugzillaConfiguration rc = getRepository().getConfiguration();
- final BugzillaVersion installedVersion = rc != null ? rc.getInstalledVersion() : null;
- boolean pre4 = installedVersion != null ? installedVersion.compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_0) <= 0 : false;
- TaskData taskData = m.getLocalTaskData();
- if(pre4) {
- return BugzillaOperation.reassignbycomponent.getInputId() != null ?
- taskData.getRoot().getMappedAttribute(BugzillaOperation.reassignbycomponent.getInputId()) != null :
- false;
- } else {
- TaskAttribute ta = taskData.getRoot().getAttribute(BugzillaAttribute.SET_DEFAULT_ASSIGNEE.getKey());
- return ta != null;
- }
- }
-
- boolean hasTimeTracking() {
- NbTaskDataModel m = getModel();
- return m != null && m.getLocalTaskData().getRoot()
- .getMappedAttribute(BugzillaAttribute.ACTUAL_TIME.getKey()) != null; // XXX dummy
- }
-
- void reassign(String user) {
- NbTaskDataModel m = getModel();
- setOperation(BugzillaOperation.reassign);
- TaskAttribute rta = m.getLocalTaskData().getRoot();
- TaskAttribute ta = rta.getMappedAttribute(BugzillaOperation.reassign.getInputId());
- if(ta != null) {
- setValue(m, ta, user);
- }
- ta = rta.getMappedAttribute(BugzillaAttribute.ASSIGNED_TO.getKey());
- if(ta != null) {
- setValue(m, ta, user);
- }
- }
-
- void verify() {
- setOperation(BugzillaOperation.verify);
- }
-
- void close() {
- setOperation(BugzillaOperation.close);
- }
-
- void reopen() {
- setOperation(BugzillaOperation.reopen);
- }
-
- private void setOperation (BugzillaOperation operation) {
- NbTaskDataModel m = getModel();
- TaskAttributeMapper mapper = m.getLocalTaskData().getAttributeMapper();
- for (TaskOperation op : mapper.getTaskOperations(m.getLocalTaskData().getRoot())) {
- if (op.getOperationId().equals(operation.toString())) {
- setOperation(op);
- return;
- }
- }
- // no operation found, leave to NO_OP ~ Leave as...
- setOperation(BugzillaOperation.none);
- }
-
- private void setOperation (TaskOperation operation) {
- NbTaskDataModel m = getModel();
- TaskAttribute rta = m.getLocalTaskData().getRoot();
- TaskAttribute ta = rta.getMappedAttribute(TaskAttribute.OPERATION);
- m.getLocalTaskData().getAttributeMapper().setTaskOperation(ta, operation);
- m.attributeChanged(ta);
- }
-
- List getAttachments() {
- NbTaskDataModel m = getModel();
- List attrs = m == null ? null : m.getLocalTaskData()
- .getAttributeMapper().getAttributesByType(m.getLocalTaskData(), TaskAttribute.TYPE_ATTACHMENT);
- if (attrs == null) {
- return Collections.emptyList();
- }
- List attachments = new ArrayList(attrs.size());
- for (TaskAttribute taskAttribute : attrs) {
- attachments.add(new Attachment(taskAttribute));
- }
- return attachments;
- }
-
- public void addAttachment(File file, final String comment, final String desc, String contentType, final boolean patch) {
- assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
- final FileTaskAttachmentSource attachmentSource = new FileTaskAttachmentSource(file);
- if (contentType == null) {
- file = FileUtil.normalizeFile(file);
- String ct = FileUtil.getMIMEType(FileUtil.toFileObject(file));
- if ((ct != null) && (!"content/unknown".equals(ct))) { // NOI18N
- contentType = ct;
- } else {
- contentType = FileTaskAttachmentSource.getContentTypeFromFilename(file.getName());
- }
- }
- attachmentSource.setContentType(contentType);
- TaskData repositoryTaskData = getRepositoryTaskData();
- if (repositoryTaskData == null && (!synchronizeTask()
- || (repositoryTaskData = getRepositoryTaskData()) == null)) {
- // not fully initialized task, sync failed
- return;
- }
- final TaskAttribute attAttribute = new TaskAttribute(repositoryTaskData.getRoot(), TaskAttribute.TYPE_ATTACHMENT);
- TaskAttributeMapper mapper = attAttribute.getTaskData().getAttributeMapper();
- TaskAttribute a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_DESCRIPTION);
- a.setValue(desc);
- a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_IS_PATCH);
- mapper.setBooleanValue(a, patch);
- a = attAttribute.createMappedAttribute(TaskAttribute.ATTACHMENT_CONTENT_TYPE);
- a.setValue(contentType);
-
- AddAttachmentCommand cmd = new AddAttachmentCommand(getID(), repository, comment, attachmentSource, file, attAttribute);
- repository.getExecutor().execute(cmd);
- if(!cmd.hasFailed()) {
- refresh(true); // XXX to much refresh - is there no other way?
- }
- }
-
- Comment[] getComments() {
- final List comments = new ArrayList<>();
- runWithModelLoaded(new Runnable() {
- @Override
- public void run() {
- NbTaskDataModel m = getModel();
- List attrs = m == null ? null : m.getLocalTaskData()
- .getAttributeMapper().getAttributesByType(m.getLocalTaskData(), TaskAttribute.TYPE_COMMENT);
- if (attrs != null) {
- for (TaskAttribute taskAttribute : attrs) {
- comments.add(new Comment(taskAttribute));
- }
- }
- }
- });
- return comments.toArray(new Comment[0]);
- }
-
- // XXX carefull - implicit refresh
- public void addComment (final String comment, final boolean close) {
- assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
- if(comment == null && !close) {
- return;
- }
- refresh();
-
- runWithModelLoaded(new Runnable() {
- @Override
- public void run () {
- // resolved attrs
- if (close) {
- Bugzilla.LOG.log(Level.FINER, "resolving issue #{0} as fixed", new Object[]{getID()});
- resolve(RESOLVE_FIXED); // XXX constant?
-
- if(BugzillaUtil.isNbRepository(repository)) {
- // check for other preselections
- Properties p = System.getProperties();
- Enumeration keys = p.keys();
- List keyList = new LinkedList<>();
- while(keys.hasMoreElements()) {
- Object key = keys.nextElement();
- if(key.toString().startsWith(VCSHOOK_BUGZILLA_FIELD)) {
- keyList.add(key.toString());
- }
- }
- for (String key : keyList) {
- String fieldName = key.substring(VCSHOOK_BUGZILLA_FIELD.length());
- String value = p.getProperty(key);
- IssueField issueField = repository.getConfiguration().getField(fieldName);
- if(issueField != null) {
- if(issueField.isReadOnly()) {
- Bugzilla.LOG.log(Level.WARNING, "field [{0}] is read-only.", new Object[]{repository.getUrl(), fieldName});
- } else {
- setFieldValue(issueField, value);
- }
- } else {
- Bugzilla.LOG.log(Level.WARNING, "Repsitory [{0}] has no field [{1}]", new Object[]{repository.getUrl(), fieldName});
- }
- }
- }
-
- }
- if(comment != null) {
- addComment(comment);
- }
-
- submitAndRefresh();
- }
- });
- }
-
- public void addComment (final String comment) {
- if(comment != null && !comment.isEmpty()) {
- runWithModelLoaded(new Runnable() {
- @Override
- public void run () {
- Bugzilla.LOG.log(Level.FINER, "adding comment [{0}] to issue #{1}", new Object[]{comment, getID()});
- TaskAttribute ta = getModel().getLocalTaskData().getRoot().getMappedAttribute(IssueField.COMMENT.getKey());
- String value = ta.getValue();
- if (value == null || value.trim().isEmpty()) {
- value = comment;
- } else {
- value += "\n\n" + comment; //NOI18N
- }
- setValue(getModel(), ta, value);
- }
- });
- }
- }
-
- private void setDueDateAndSubmit (final Date date) {
- refresh();
- runWithModelLoaded(new Runnable() {
- @Override
- public void run () {
- if (date == null) {
- setFieldValue(IssueField.DEADLINE, "");
- } else {
- setFieldValue(IssueField.DEADLINE, DUE_DATE_FORMAT.format(date));
- }
- submitAndRefresh();
- }
- });
- }
-
- public void attachPatch(File file, String description, boolean isPatch) {
- // HACK for attaching hg bundles - they are NOT patches
- isPatch = !file.getName().endsWith(".hg"); // NOI18N
- addAttachment(file, null, description, null, isPatch);
- }
-
- private void prepareSubmit() {
- if (initialProduct != null) {
- // product change
- TaskAttribute ta = getModel().getLocalTaskData().getRoot().getMappedAttribute(BugzillaAttribute.CONFIRM_PRODUCT_CHANGE.getKey());
- if (ta == null) {
- ta = BugzillaTaskDataHandler.createAttribute(getModel().getLocalTaskData().getRoot(), BugzillaAttribute.CONFIRM_PRODUCT_CHANGE);
- }
- setValue(getModel(), ta, "1"); //NOI18N
- }
- }
-
- @NbBundle.Messages({
- "# {0} - task id and summary",
- "MSG_BugzillaIssue.statusBar.submitted=Task {0} submitted.",
- "MSG_LOG_FILE_DESC=IDE log",
- "BugzillaIssue.attachment.noDescription="
- })
- public boolean submitAndRefresh() {
- final boolean[] result = new boolean[1];
- runWithModelLoaded(new Runnable() {
-
- @Override
- public void run () {
- assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
-
- prepareSubmit();
- boolean addIDELog = fixAttachLog();
- List newAttachments = getNewAttachments();
- if (!newAttachments.isEmpty()) {
- // clear before submit, we do not know how connectors deal with internal attributes
- setNewAttachments(Collections.emptyList());
- }
- final boolean wasNew = isNew();
-
- SubmitTaskCommand submitCmd;
- try {
- if (saveChanges()) {
- fireChanged();
- submitCmd = MylynSupport.getInstance().getCommandFactory().createSubmitTaskCommand(getModel());
- } else {
- result[0] = false;
- return;
- }
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- result[0] = false;
- return;
- }
- repository.getExecutor().execute(submitCmd);
- if (!submitCmd.hasFailed()) {
- taskSubmitted(submitCmd.getSubmittedTask());
- }
-
- if (!wasNew) {
- refresh();
- if (wasDuplicated && !submitCmd.hasFailed()) {
- try {
- BugzillaIssue dupe = repository.getIssueCache().getIssue(getFieldValue(IssueField.DUPLICATE_ID));
- if(dupe != null) {
- // if duplicate known on client then refresh to
- // avoid potential mid-air ...
- dupe.refresh();
- }
- } finally {
- wasDuplicated = false;
- }
- }
- } else {
- RepositoryResponse rr = submitCmd.getRepositoryResponse();
- if(!submitCmd.hasFailed()) {
- updateRecentChanges();
- updateTooltip();
- fireDataChanged();
- String id = getID();
- repository.getIssueCache().setIssue(id, BugzillaIssue.this);
- Bugzilla.LOG.log(Level.FINE, "created issue #{0}", id);
- // a new issue was created -> refresh all queries
- repository.refreshAllQueries();
- } else {
- Bugzilla.LOG.log(Level.FINE, "submiting failed");
- if(rr != null) {
- Bugzilla.LOG.log(Level.FINE, "repository response {0}", rr.getReposonseKind());
- } else {
- Bugzilla.LOG.log(Level.FINE, "no repository response available");
- }
- }
- }
-
- if(submitCmd.hasFailed()) {
- result[0] = false;
- boolean needSave = false;
- if (addIDELog) {
- setFieldValue(IssueField.NB_ATTACH_IDE_LOG, "1"); //NOI18N
- needSave = true;
- }
- if (!newAttachments.isEmpty()) {
- setNewAttachments(newAttachments);
- needSave = true;
- }
- if (needSave) {
- saveChanges();
- }
- return;
- } else {
- if (addIDELog) {
- File f = new File(Places.getUserDirectory(), NbBugzillaConstants.NB_LOG_FILE_PATH);
- if (f.isFile()) {
- addAttachment(f, "", MSG_LOG_FILE_DESC(), NbBugzillaConstants.NB_LOG_FILE_ATT_CONT_TYPE, false);
- }
- }
- if (!newAttachments.isEmpty()) {
- for (AttachmentsPanel.AttachmentInfo attachment : newAttachments) {
- if (attachment.getFile().isFile()) {
- if (attachment.getDescription().trim().length() == 0) {
- attachment.setDescription(Bundle.BugzillaIssue_attachment_noDescription());
- }
- addAttachment(attachment.getFile(), null, attachment.getDescription(), attachment.getContentType(), attachment.isPatch()); // NOI18N
- } else {
- // PENDING notify user
- }
- }
- }
- }
- StatusDisplayer.getDefault().setStatusText(Bundle.MSG_BugzillaIssue_statusBar_submitted(
- getDisplayName()));
-
- setUpToDate(true, false);
- result[0] = true;
- }
-
- private boolean fixAttachLog () {
- String val = getFieldValue(IssueField.NB_ATTACH_IDE_LOG);
- getModel().getLocalTaskData().getRoot().removeAttribute(IssueField.NB_ATTACH_IDE_LOG.getKey());
- return "1".equals(val);
- }
-
- });
- return result[0];
- }
-
- void updateModelAndRefresh () {
- runWithModelLoaded(new Runnable() {
- @Override
- public void run() {
- updateModel();
- refresh();
- }
- });
- }
-
- public boolean refresh() {
- assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
- return refresh(false);
- }
-
- private boolean refresh (boolean afterSubmitRefresh) { // XXX cacheThisIssue - we probalby don't need this, just always set the issue into the cache
- assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
- boolean synced = synchronizeTask();
- if (!loading) {
- // refresh only when model is not currently being loaded
- // otherwise it most likely ends up in editor not fully initialized
- refreshViewData(afterSubmitRefresh);
- }
- return synced;
- }
-
- private void refreshViewData(boolean force) {
- if (controller != null) {
- // view might not exist yet and we won't unnecessarily create it
- controller.refreshViewData(force);
- }
- }
-
- /**
- * Returns available operations for this issue
- * @return
- */
- Map getAvailableOperations () {
- if (availableOperations == null) {
- HashMap operations = new HashMap(5);
- NbTaskDataModel model = getModel();
- List allOperations = model.getLocalTaskData().getAttributeMapper().getAttributesByType(model.getLocalTaskData(), TaskAttribute.TYPE_OPERATION);
- for (TaskAttribute operation : allOperations) {
- // the test must be here, 'operation' (applying writable action) is also among allOperations
- if (operation.getId().startsWith(TaskAttribute.PREFIX_OPERATION)) {
- operations.put(operation.getId().substring(TaskAttribute.PREFIX_OPERATION.length()), TaskOperation.createFrom(operation));
- }
- }
- availableOperations = operations;
- }
-
- return availableOperations;
- }
-
- boolean isResolveAvailable () {
- Map operations = getAvailableOperations();
- return operations.containsKey(BugzillaOperation.resolve.toString());
- }
-
- private String getMappedValue(TaskAttribute a, String key) {
- TaskAttribute ma = a.getMappedAttribute(key);
- if(ma != null) {
- return ma.getValue();
- }
- return null;
- }
-
- public void setUpToDate (boolean seen) {
- setUpToDate(seen, true);
- }
-
- private boolean updateTooltip () {
- String displayName = getDisplayName();
- if (displayName.startsWith("#")) { //NOI18N
- displayName = displayName.replaceFirst("#", ""); //NOI18N
- }
- String oldTooltip = tooltip;
-
- SynchronizationState state = getSynchronizationState();
- URL iconPath = getStateIcon(state);
- String iconCode = "";
- if (iconPath != null) {
- iconCode = " "; //NOI18N
- }
- String stateName = getStateDisplayName(state);
-
- String priorityLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Priority_Title"); //NOI18N
- String priority = getRepositoryFieldValue(IssueField.PRIORITY);
- URL priorityIcon = BugzillaConfig.getInstance().getPriorityIconURL(priority);
-
- boolean showIssueType = BugzillaUtil.showIssueType(repository);
- String typeLabel = NbBundle.getMessage(BugzillaIssue.class, showIssueType ? "LBL_Type" : "CTL_Issue_Severity_Title"); //NOI18N
- String type = showIssueType ? getRepositoryFieldValue(IssueField.ISSUE_TYPE) : getRepositoryFieldValue(IssueField.SEVERITY);
-
- String productLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Product_Title"); //NOI18N
- String product = getRepositoryFieldValue(IssueField.PRODUCT);
-
- String componentLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Component_Title"); //NOI18N
- String component = getRepositoryFieldValue(IssueField.COMPONENT);
-
- String assigneeLabel = NbBundle.getMessage(BugzillaIssue.class, "LBL_Assigned"); //NOI18N
- String assignee = getRepositoryFieldValue(IssueField.ASSIGNED_TO);
-
- String statusLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Status_Title"); //NOI18N
- String status = getRepositoryFieldValue(IssueField.STATUS);
- String resolution = getRepositoryFieldValue(IssueField.RESOLUTION);
-
- if (resolution != null && !resolution.trim().isEmpty()) {
- status += "/" + resolution; //NOI18N
- }
- String scheduledLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Scheduled_Title"); //NOI18N
- String scheduled = getScheduleDisplayString();
-
- String dueLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Due_Title"); //NOI18N
- String due = getDueDisplayString();
-
-
- String estimateLabel = NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Estimate_Title"); //NOI18N
- String estimate = getEstimateDisplayString();
-
- String fieldTable = "" //NOI18N
- + "" + priorityLabel + ": " + priority + "" + typeLabel + ": " + type + " " //NOI18N
- + "" + productLabel + ": " + product + " " + componentLabel + ": " + component + " " //NOI18N
- + "" + assigneeLabel + ": " + assignee + " "
- + "" + statusLabel + ": " + status + " "; //NOI18N
-
- if (!scheduled.isEmpty()) {
- fieldTable += "" + scheduledLabel + ": " + scheduled + " "; //NOI18N
- }
- boolean addNewLine = !due.isEmpty() || !estimate.isEmpty();
- if (addNewLine) {
- fieldTable += ""; //NOI18N
- }
- if (!due.isEmpty()) {
- fieldTable += " " + dueLabel + ": " + due + " "; //NOI18N
- }
- if (!estimate.isEmpty()) {
- fieldTable += "" + estimateLabel + ": " + estimate + " "; //NOI18N
- }
- if (addNewLine) {
- fieldTable += " "; //NOI18N
- }
- fieldTable += "
"; //NOI18N
-
- StringBuilder sb = new StringBuilder(""); //NOI18N
- sb.append("").append(displayName).append(" "); //NOI18N
- if (stateName != null && !stateName.isEmpty()) {
- sb.append("").append(iconCode).append(stateName).append("
"); //NOI18N
- }
- sb.append(" "); //NOI18N
- sb.append(fieldTable);
- sb.append(""); //NOI18N
- tooltip = sb.toString();
- return !oldTooltip.equals(tooltip);
- }
-
- private URL getStateIcon(SynchronizationState state) {
- URL iconPath = null;
- if (state.equals(SynchronizationState.CONFLICT)) {
- iconPath = ICON_CONFLICT_PATH;
- } else if (state.equals(SynchronizationState.INCOMING) || state.equals(SynchronizationState.INCOMING_NEW)) {
- iconPath = ICON_REMOTE_PATH;
- } else if (state.equals(SynchronizationState.OUTGOING) || state.equals(SynchronizationState.OUTGOING_NEW)) {
- iconPath = ICON_UNSUBMITTED_PATH;
- }
- return iconPath;
- }
-
- private String getStateDisplayName(SynchronizationState state) {
- String displayName = "";
- if (state.equals(SynchronizationState.CONFLICT)) {
- displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_ConflictShort"); //NOI18N;
- } else if (state.equals(SynchronizationState.INCOMING)) {
- displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_RemoteShort"); //NOI18N;
- } else if (state.equals(SynchronizationState.INCOMING_NEW)) {
- displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_RemoteNewShort"); //NOI18N;
- } else if (state.equals(SynchronizationState.OUTGOING)) {
- displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_UnsubmittedShort"); //NOI18N;
- } else if (state.equals(SynchronizationState.OUTGOING_NEW)) {
- displayName = NbBundle.getMessage(BugzillaIssue.class, "LBL_UnsubmittedNewShort"); //NOI18N;
- }
- return displayName;
- }
-
- private boolean updateRecentChanges () {
- String oldChanges = recentChanges;
- recentChanges = "";
- SynchronizationState syncState = getSynchronizationState();
- if (syncState == SynchronizationState.INCOMING_NEW) {
- recentChanges = NbBundle.getMessage(BugzillaIssue.class, "LBL_NEW_STATUS"); //NOI18N
- } else if (syncState == SynchronizationState.INCOMING
- || syncState == SynchronizationState.CONFLICT) {
- try {
- NbTaskDataState taskDataState = getNbTask().getTaskDataState();
- if (taskDataState != null) {
- TaskData repositoryData = taskDataState.getRepositoryData();
- TaskData lastReadData = taskDataState.getLastReadData();
- List changedFields = new ArrayList<>();
- for (IssueField f : getRepository().getConfiguration().getFields()) {
- if (f==IssueField.MODIFICATION
- || f==IssueField.REPORTER_NAME
- || f==IssueField.QA_CONTACT_NAME
- || f==IssueField.ASSIGNED_TO_NAME) {
- continue;
- }
- String value = getFieldValue(repositoryData, f);
- String seenValue = getFieldValue(lastReadData, f);
- if(!value.trim().equals(seenValue.trim())) {
- changedFields.add(f);
- }
- }
- int changedCount = changedFields.size();
- if(changedCount == 1) {
- String ret = null;
- for (IssueField changedField : changedFields) {
- if (changedField == IssueField.SUMMARY) {
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_SUMMARY_CHANGED_STATUS"); // NOI18N
- } else if (changedField == IssueField.CC) {
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_CC_FIELD_CHANGED_STATUS"); // NOI18N
- } else if (changedField == IssueField.KEYWORDS) {
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_KEYWORDS_CHANGED_STATUS"); // NOI18N
- } else if (changedField == IssueField.DEPENDS_ON || changedField == IssueField.BLOCKS) {
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_DEPENDENCE_CHANGED_STATUS"); // NOI18N
- } else if (changedField == IssueField.COMMENT_COUNT) {
- String value = getFieldValue(repositoryData, changedField);
- String seenValue = getFieldValue(lastReadData, changedField);
- if(seenValue.equals("")) { // NOI18N
- seenValue = "0"; // NOI18N
- }
- int count = 0;
- try {
- count = Integer.parseInt(value) - Integer.parseInt(seenValue);
- } catch(NumberFormatException ex) {
- Bugzilla.LOG.log(Level.WARNING, ret, ex);
- }
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_COMMENTS_CHANGED", new Object[] {count}); // NOI18N
- } else if (changedField == IssueField.ATTACHEMENT_COUNT) {
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_ATTACHMENTS_CHANGED"); // NOI18N
- } else {
- ret = NbBundle.getMessage(BugzillaIssue.class, "LBL_CHANGED_TO", new Object[] {changedField.getDisplayName(), getFieldValue(repositoryData, changedField)}); // NOI18N
- }
- }
- recentChanges = ret;
- } else {
- for (IssueField changedField : changedFields) {
- String key;
- if (changedField == IssueField.SUMMARY) {
- key = "LBL_CHANGES_INCL_SUMMARY"; // NOI18N
- } else if (changedField == IssueField.PRIORITY) {
- key = "LBL_CHANGES_INCL_PRIORITY"; // NOI18N
- } else if (changedField == IssueField.SEVERITY) {
- key = "LBL_CHANGES_INCL_SEVERITY"; // NOI18N
- } else if (changedField == IssueField.ISSUE_TYPE) {
- key = "LBL_CHANGES_INCL_ISSUE_TYPE"; // NOI18N
- } else if (changedField == IssueField.PRODUCT) {
- key = "LBL_CHANGES_INCL_PRODUCT"; // NOI18N
- } else if (changedField == IssueField.COMPONENT) {
- key = "LBL_CHANGES_INCL_COMPONENT"; // NOI18N
- } else if (changedField == IssueField.PLATFORM) {
- key = "LBL_CHANGES_INCL_PLATFORM"; // NOI18N
- } else if (changedField == IssueField.VERSION) {
- key = "LBL_CHANGES_INCL_VERSION"; // NOI18N
- } else if (changedField == IssueField.MILESTONE) {
- key = "LBL_CHANGES_INCL_MILESTONE"; // NOI18N
- } else if (changedField == IssueField.KEYWORDS) {
- key = "LBL_CHANGES_INCL_KEYWORDS"; // NOI18N
- } else if (changedField == IssueField.URL) {
- key = "LBL_CHANGES_INCL_URL"; // NOI18N
- } else if (changedField == IssueField.ASSIGNED_TO) {
- key = "LBL_CHANGES_INCL_ASSIGNEE"; // NOI18N
- } else if (changedField == IssueField.QA_CONTACT) {
- key = "LBL_CHANGES_INCL_QA_CONTACT"; // NOI18N
- } else if (changedField == IssueField.DEPENDS_ON || changedField == IssueField.BLOCKS) {
- key = "LBL_CHANGES_INCLUSIVE_DEPENDENCE"; // NOI18N
- } else {
- key = "LBL_CHANGES"; // NOI18N
- }
- recentChanges = NbBundle.getMessage(BugzillaIssue.class, key, new Object[] {changedCount});
- }
- }
- }
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- }
- }
- return !oldChanges.equals(recentChanges);
- }
-
- @Override
- protected void modelSaved (NbTaskDataModel model) {
- if (controller != null) {
- controller.modelStateChanged(model.isDirty(), model.hasOutgoingChanged());
- }
- }
-
- @Override
- protected String getSummary (TaskData taskData) {
- return getFieldValue(taskData, IssueField.SUMMARY);
- }
-
- @Override
- protected void attributeChanged (NbTaskDataModelEvent event, NbTaskDataModel model) {
- if (controller != null) {
- // view might not exist yet and we won't unnecessarily create it
- controller.modelStateChanged(model.isDirty(), model.isDirty() || !model.getChangedAttributes().isEmpty());
- }
- }
-
- @Override
- protected boolean synchronizeTask () {
- try {
- NbTask task = getNbTask();
- synchronized (task) {
- Bugzilla.LOG.log(Level.FINE, "refreshing issue #{0}", task.getTaskId());
- SynchronizeTasksCommand cmd = MylynSupport.getInstance().getCommandFactory().createSynchronizeTasksCommand(
- getRepository().getTaskRepository(), Collections.singleton(task));
- getRepository().getExecutor().execute(cmd);
- return !cmd.hasFailed();
- }
- } catch (CoreException ex) {
- // should not happen
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- return false;
- }
- }
-
- boolean save () {
- return saveChanges();
- }
-
- private void setValue (NbTaskDataModel model, TaskAttribute ta, String value) {
- TaskData repositoryTaskData = model.getRepositoryTaskData();
- if (value.isEmpty() && repositoryTaskData != null) {
- // should be empty or set to ""???
- TaskAttribute a = repositoryTaskData.getRoot().getAttribute(ta.getId());
- if (a == null || a.getValues().isEmpty()) {
- // repository value is also empty list, so let's set to the same
- ta.clearValues();
- } else {
- ta.setValue(value);
- }
- } else {
- ta.setValue(value);
- }
- model.attributeChanged(ta);
- }
-
- boolean setUnsubmittedAttachments (List newAttachments) {
- return super.setNewAttachments(newAttachments);
- }
-
- List getUnsubmittedAttachments () {
- return getNewAttachments();
- }
-
- void setTaskPrivateNotes (String notes) {
- super.setPrivateNotes(notes);
- if (controller != null) {
- controller.modelStateChanged(true, hasLocalEdits());
- }
- }
-
- public void setTaskDueDate (final Date date, final boolean persistChange) {
- runWithModelLoaded(new Runnable() {
-
- @Override
- public void run () {
- if (hasTimeTracking()) {
- setDueDateAndSubmit(date);
- } else {
- setDueDate(date, persistChange);
- if (controller != null) {
- controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits());
- }
- if (persistChange) {
- dataChanged();
- }
- }
- }
- });
- }
-
- public void setTaskScheduleDate (IssueScheduleInfo date, boolean persistChange) {
- super.setScheduleDate(date, persistChange);
- if (controller != null) {
- controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits());
- }
- if (persistChange) {
- dataChanged();
- }
- }
-
- public void setTaskEstimate (int estimate, boolean persistChange) {
- super.setEstimate(estimate, persistChange);
- if (controller != null) {
- controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits());
- }
- if (persistChange) {
- dataChanged();
- }
- }
-
- public boolean discardLocalEdits () {
- final boolean retval[] = new boolean[1];
- runWithModelLoaded(new Runnable() {
- @Override
- public void run () {
- clearUnsavedChanges();
- retval[0] = cancelChanges();
- if (controller != null) {
- controller.modelStateChanged(hasUnsavedChanges(), hasLocalEdits());
- controller.refreshViewData(false);
- }
- }
- });
- return retval[0];
- }
-
- public String getPriority() {
- return getRepositoryFieldValue(IssueField.PRIORITY);
- }
-
- class Comment {
- private final Date when;
- private final String author;
- private final String authorName;
- private final Long number;
- private final String text;
- private final Double worked;
-
- public Comment(TaskAttribute a) {
- Date d = null;
- String s = "";
- try {
- s = getMappedValue(a, TaskAttribute.COMMENT_DATE);
- if(s != null && !s.trim().equals("")) { // NOI18N
- d = CC_DATE_FORMAT.parse(s);
- }
- } catch (ParseException ex) {
- Bugzilla.LOG.log(Level.SEVERE, s, ex);
- }
- when = d;
- TaskAttribute authorAttr = a.getMappedAttribute(TaskAttribute.COMMENT_AUTHOR);
- if (authorAttr != null) {
- author = authorAttr.getValue();
- TaskAttribute nameAttr = authorAttr.getMappedAttribute(TaskAttribute.PERSON_NAME);
- authorName = nameAttr != null ? nameAttr.getValue() : null;
- } else {
- author = authorName = null;
- }
- String n = getMappedValue(a, TaskAttribute.COMMENT_NUMBER);
- number = n != null ? Long.parseLong(n) : null;
- text = getMappedValue(a, TaskAttribute.COMMENT_TEXT);
- String workedString = getMappedValue(a, BugzillaAttribute.WORK_TIME.getKey());
-
- double dbWorked = 0;
- if(workedString == null || workedString.isEmpty()) {
- dbWorked = 0.0;
- } else {
- try {
- dbWorked = Double.parseDouble(workedString);
- } catch (NumberFormatException e) {
- Bugzilla.LOG.log(Level.WARNING, "WORK_TIME time for comment " + number + " is " + workedString , e);
- dbWorked = 0;
- }
- }
- worked = dbWorked;
- }
-
- public Long getNumber() {
- return number;
- }
-
- public String getText() {
- return text;
- }
-
- public Date getWhen() {
- return when;
- }
-
- public String getAuthor() {
- return author;
- }
-
- public String getAuthorName() {
- return authorName;
- }
-
- public Double getWorked() {
- return worked;
- }
- }
-
- class Attachment extends AttachmentsPanel.AbstractAttachment {
- private final String desc;
- private final String filename;
- private final String author;
- private final String authorName;
- private final Date date;
- private final String id;
- private final String contentType;
- private final String isDeprected;
- private final String size;
- private final String isPatch;
- private final String url;
-
- public Attachment(TaskAttribute ta) {
- id = ta.getValue();
- Date d = null;
- String s = "";
- try {
- s = getMappedValue(ta, TaskAttribute.ATTACHMENT_DATE);
- if(s != null && !s.trim().equals("")) { // NOI18N
- d = CC_DATE_FORMAT.parse(s);
- }
- } catch (ParseException ex) {
- Bugzilla.LOG.log(Level.SEVERE, s, ex);
- }
- date = d;
- filename = getMappedValue(ta, TaskAttribute.ATTACHMENT_FILENAME);
- desc = getMappedValue(ta, TaskAttribute.ATTACHMENT_DESCRIPTION);
-
- TaskAttribute authorAttr = ta.getMappedAttribute(TaskAttribute.ATTACHMENT_AUTHOR);
- if(authorAttr != null) {
- author = authorAttr.getValue();
- TaskAttribute nameAttr = authorAttr.getMappedAttribute(TaskAttribute.PERSON_NAME);
- authorName = nameAttr != null ? nameAttr.getValue() : null;
- } else {
- authorAttr = ta.getTaskData().getRoot().getMappedAttribute(IssueField.REPORTER.getKey());
- if(authorAttr != null) {
- author = authorAttr.getValue();
- TaskAttribute nameAttr = authorAttr.getMappedAttribute(TaskAttribute.PERSON_NAME);
- authorName = nameAttr != null ? nameAttr.getValue() : null;
- } else {
- author = authorName = null;
- }
- }
- contentType = getMappedValue(ta, TaskAttribute.ATTACHMENT_CONTENT_TYPE);
- isDeprected = getMappedValue(ta, TaskAttribute.ATTACHMENT_IS_DEPRECATED);
- isPatch = getMappedValue(ta, TaskAttribute.ATTACHMENT_IS_PATCH);
- size = getMappedValue(ta, TaskAttribute.ATTACHMENT_SIZE);
- url = getMappedValue(ta, TaskAttribute.ATTACHMENT_URL);
- }
-
- @Override
- public boolean isPatch() {
- return "1".equals(isPatch);
- }
-
- @Override
- public String getAuthorName() {
- return authorName;
- }
-
- @Override
- public String getAuthor() {
- return author;
- }
-
- @Override
- public Date getDate() {
- return date;
- }
-
- @Override
- public String getDesc() {
- return desc;
- }
-
- @Override
- public String getFilename() {
- return filename;
- }
-
- @Override
- public String getContentType() {
- return contentType;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public boolean isDeprecated() {
- return "1".equals(isDeprected);
- }
-
- public String getSize() {
- return size;
- }
-
- public String getUrl() {
- return url;
- }
-
- @Override
- public void getAttachementData(final OutputStream os) {
- assert !EventQueue.isDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
- repository.getExecutor().execute(new GetAttachmentCommand(repository, id, os));
- }
-
- @Override
- public void open() {
- super.open(); //To change body of generated methods, choose Tools | Templates.
- }
-
- }
-
- @Override
- protected void taskDataUpdated () {
- availableOperations = null;
- ensureConfigurationUptodate();
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run() {
- dataChanged();
- }
- });
- }
-
- private void dataChanged () {
- updateTooltip();
- fireDataChanged();
- refreshViewData(false);
- }
-
- @Override
- protected void taskModified (boolean syncStateChanged) {
- if (updateRecentChanges() | updateTooltip()) {
- fireDataChanged();
- }
- if (syncStateChanged) {
- fireStatusChanged();
- }
- }
-
- void fireChangeEvent () {
- fireChanged();
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java
deleted file mode 100644
index 221d5e4011e9..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueController.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.issue;
-
-import java.beans.PropertyChangeListener;
-import javax.swing.JComponent;
-import org.netbeans.modules.bugtracking.spi.IssueController;
-import org.netbeans.modules.bugtracking.commons.UIUtils;
-import org.openide.util.HelpCtx;
-
-/**
- *
- * @author Tomas Stupka, Jan Stola
- */
-public class BugzillaIssueController implements IssueController {
- private final IssuePanel issuePanel;
-
- public BugzillaIssueController(BugzillaIssue issue) {
- IssuePanel panel = new IssuePanel();
- panel.setIssue(issue);
- issuePanel = panel;
- UIUtils.keepFocusedComponentVisible(issuePanel);
- }
-
- @Override
- public JComponent getComponent() {
- return issuePanel;
- }
-
- @Override
- public void opened() {
- BugzillaIssue issue = issuePanel.getIssue();
- if (issue != null) {
- issuePanel.opened();
- }
- }
-
- @Override
- public void closed() {
- BugzillaIssue issue = issuePanel.getIssue();
- if (issue != null) {
- issuePanel.closed();
- }
- }
-
- @Override
- public HelpCtx getHelpCtx() {
- return new HelpCtx("org.netbeans.modules.bugzilla.issue.BugzillaIssue"); // NOI18N
- }
-
- void refreshViewData(boolean force) {
- issuePanel.reloadFormInAWT(force);
- }
-
- void modelStateChanged (boolean modelDirty, boolean modelHasLocalChanges) {
- issuePanel.modelStateChanged(modelDirty, modelHasLocalChanges);
- }
-
- @Override
- public boolean saveChanges() {
- return issuePanel.saveSynchronously();
- }
-
- @Override
- public boolean discardUnsavedChanges() {
- issuePanel.clearUnsavedChanges();
- return true;
- }
-
- @Override
- public void addPropertyChangeListener(PropertyChangeListener l) {
- issuePanel.getIssue().addPropertyChangeListener(l);
- }
-
- @Override
- public void removePropertyChangeListener(PropertyChangeListener l) {
- issuePanel.getIssue().removePropertyChangeListener(l);
- }
-
- @Override
- public boolean isChanged() {
- return issuePanel.isChanged();
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java
deleted file mode 100644
index 3e2f995ed2d0..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/BugzillaIssueNode.java
+++ /dev/null
@@ -1,277 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.issue;
-
-import java.util.List;
-import org.netbeans.modules.bugtracking.issuetable.IssueNode;
-import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.BugzillaConnector;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.repository.IssueField;
-import org.openide.nodes.Node.Property;
-import org.openide.util.NbBundle;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaIssueNode extends IssueNode {
- public BugzillaIssueNode(BugzillaIssue issue) {
- super(BugzillaConnector.ID,
- issue.getRepository().getID(),
- issue,
- Bugzilla.getInstance().getIssueProvider(),
- Bugzilla.getInstance().getStatusProvider(),
- Bugzilla.getInstance().getChangesProvider());
- }
-
- BugzillaIssue getBugzillaIssue() {
- return getIssueData();
- }
-
- @Override
- protected Property>[] getProperties() {
- return new Property>[] {
- new IDProperty(),
- NBBugzillaUtils.isNbRepository(getBugzillaIssue().getRepository().getUrl())
- ? new IssueTypeProperty()
- : new SeverityProperty(),
- new PriorityProperty(),
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_STATUS, IssueField.STATUS, "CTL_Issue_Status_Title", "CTL_Issue_Status_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_ASSIGNED_TO, IssueField.ASSIGNED_TO, "CTL_Issue_Assigned_Title", "CTL_Issue_Status_Desc"), // NOI18N
- new ResolutionProperty(),
- new SummaryProperty(),
- new ModificationProperty(),
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_PRODUCT, IssueField.PRODUCT, "CTL_Issue_Product_Title", "CTL_Issue_Product_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_COMPONENT, IssueField.COMPONENT, "CTL_Issue_Component_Title", "CTL_Issue_Component_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_VERSION, IssueField.VERSION, "CTL_Issue_Version_Title", "CTL_Issue_Version_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_OS, IssueField.OS, "CTL_Issue_OS_Title", "CTL_Issue_OS_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_PLATFORM, IssueField.PLATFORM, "CTL_Issue_Platform_Title", "CTL_Issue_Platform_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_MILESTONE, IssueField.MILESTONE, "CTL_Issue_Milestone_Title", "CTL_Issue_Milestone_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_REPORTER, IssueField.REPORTER_NAME, "CTL_Issue_Reporter_Title", "CTL_Issue_Reporter_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_QA_CONTACT, IssueField.QA_CONTACT_NAME, "CTL_Issue_QA_Contact_Title", "CTL_Issue_QA_Contact_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_KEYWORDS, IssueField.KEYWORDS, "CTL_Issue_Keywords_Title", "CTL_Issue_Keywords_Desc"), // NOI18N
- new BugzillaFieldProperty(BugzillaIssue.LABEL_NAME_WHITEBOARD, IssueField.WHITEBOARD, "CTL_Issue_Whiteboard_Title", "CTL_Issue_Whiteboard_Desc"), // NOI18N
- };
- };
-
- @Override
- public void fireDataChanged() {
- super.fireDataChanged();
- }
-
- private Integer getIssueTypeSortKey(String issueType) {
- BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration();
- if(bc == null || !bc.isValid()) {
- return null;
- }
- List s = bc.getIssueTypes();
- if(s == null) {
- return null;
- }
- return s.indexOf(issueType);
- }
-
- private Integer getSeveritySortKey(String severity) {
- BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration();
- if(bc == null || !bc.isValid()) {
- return null;
- }
- List s = bc.getSeverities();
- if(s == null) {
- return null;
- }
- return s.indexOf(severity);
- }
-
- private Integer getPrioritySortKey(String priority) {
- BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration();
- if(bc == null || !bc.isValid()) {
- return null;
- }
- List p = bc.getPriorities();
- if(p == null) {
- return null;
- }
- return p.indexOf(priority);
- }
-
- private Integer getResolutionSortKey(String resolution) {
- BugzillaConfiguration bc = getBugzillaIssue().getRepository().getConfiguration();
- if(bc == null || !bc.isValid()) {
- return null;
- }
- List r = bc.getResolutions();
- if(r == null) {
- return null;
- }
- return r.indexOf(resolution);
- }
-
- private class IDProperty extends IssueNode.IssueProperty {
- public IDProperty() {
- super(BugzillaIssue.LABEL_NAME_ID,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_ID_Title"), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_ID_Desc")); // NOI18N
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getID();
- }
-
- @Override
- public int compareTo(IssueNode.IssueProperty p) {
- if(p == null) return 1;
- Integer i1 = Integer.parseInt(getIssueData().getID());
- Integer i2 = Integer.parseInt(p.getIssueData().getID());
- return i1.compareTo(i2);
- }
-
- }
-
- private class SeverityProperty extends IssueNode.IssueProperty {
- public SeverityProperty() {
- super(BugzillaIssue.LABEL_NAME_SEVERITY,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Severity_Title"), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Severity_Desc")); // NOI18N
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getRepositoryFieldValue(IssueField.SEVERITY);
- }
- @Override
- public Object getValue(String attributeName) {
- if("sortkey".equals(attributeName)) { // NOI18N
- return getSeveritySortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.SEVERITY));
- } else {
- return super.getValue(attributeName);
- }
- }
- }
-
- private class IssueTypeProperty extends IssueNode.IssueProperty {
- public IssueTypeProperty() {
- super(BugzillaIssue.LABEL_NAME_ISSUE_TYPE,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Issue_Type_Title"), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Issue_Type_Desc")); // NOI18N
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getRepositoryFieldValue(IssueField.ISSUE_TYPE);
- }
- @Override
- public Object getValue(String attributeName) {
- if("sortkey".equals(attributeName)) { // NOI18N
- return getIssueTypeSortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.ISSUE_TYPE));
- } else {
- return super.getValue(attributeName);
- }
- }
- }
-
- public class PriorityProperty extends IssueNode.IssueProperty {
- public PriorityProperty() {
- super(BugzillaIssue.LABEL_NAME_PRIORITY,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Priority_Title"), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Priority_Desc")); // NOI18N
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getRepositoryFieldValue(IssueField.PRIORITY);
- }
- @Override
- public Object getValue(String attributeName) {
- if("sortkey".equals(attributeName)) { // NOI18N
- return getPrioritySortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.PRIORITY));
- } else {
- return super.getValue(attributeName);
- }
- }
- }
-
- private class ResolutionProperty extends IssueNode.IssueProperty {
- public ResolutionProperty() {
- super(BugzillaIssue.LABEL_NAME_RESOLUTION,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Resolution_Title"), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_ID_Desc")); // NOI18N
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getRepositoryFieldValue(IssueField.RESOLUTION);
- }
- @Override
- public Object getValue(String attributeName) {
- if("sortkey".equals(attributeName)) { // NOI18N
- return getResolutionSortKey(getBugzillaIssue().getRepositoryFieldValue(IssueField.RESOLUTION));
- } else {
- return super.getValue(attributeName);
- }
- }
- }
-
- private class ModificationProperty extends IssueNode.IssueProperty {
- public ModificationProperty() {
- super(BugzillaIssue.LABEL_NAME_MODIFICATION,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Modification_Title"), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, "CTL_Issue_Modification_Desc")); // NOI18N
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getRepositoryFieldValue(IssueField.MODIFICATION);
- }
- @Override
- public int compareTo(IssueNode.IssueProperty p) {
- if(p == null) return 1;
- // XXX sort as date
- String s1 = getBugzillaIssue().getRepositoryFieldValue(IssueField.MODIFICATION);
- String s2 = p.getIssueData().getRepositoryFieldValue(IssueField.MODIFICATION);
- return s1.compareTo(s2);
- }
- }
-
- private class BugzillaFieldProperty extends IssueProperty {
- private final IssueField field;
- public BugzillaFieldProperty(String fieldLabel, IssueField f, String titleProp, String descProp) {
- super(fieldLabel,
- String.class,
- NbBundle.getMessage(BugzillaIssue.class, titleProp), // NOI18N
- NbBundle.getMessage(BugzillaIssue.class, descProp)); // NOI18N
- this.field = f;
- }
- @Override
- public String getValue() {
- return getBugzillaIssue().getRepositoryFieldValue(field);
- }
- @Override
- public int compareTo(IssueNode.IssueProperty p) {
- if(p == null) return 1;
- String s1 = getBugzillaIssue().getRepositoryFieldValue(field);
- String s2 = p.getIssueData().getRepositoryFieldValue(field);
- return s1.compareTo(s2);
- }
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties
deleted file mode 100644
index 5b44b12c5872..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/Bundle.properties
+++ /dev/null
@@ -1,267 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-CTL_Issue=#{0} - {1}
-CTL_NewIssue=New Task
-
-CTL_Issue_ID_Title=ID
-CTL_Issue_ID_Desc=Task ID
-CTL_Issue_Severity_Title=Severity
-CTL_Issue_Severity_Desc=Task Severity
-CTL_Issue_Issue_Type_Title=Task Type
-CTL_Issue_Issue_Type_Desc=Task Type
-CTL_Issue_Priority_Title=Priority
-CTL_Issue_Priority_Desc=Task Priority
-CTL_Issue_Status_Title=Status
-CTL_Issue_Status_Desc=Task Status
-CTL_Issue_Resolution_Title=Resolution
-CTL_Issue_Resolution_Desc=Task Resolution
-CTL_Issue_Summary_Title=Summary
-CTL_Issue_Summary_Desc=Task Summary
-CTL_Issue_Assigned_Title=Assigned To
-CTL_Issue_Assigned_Desc=User to whom the task is assigned
-
-CTL_Issue_Scheduled_Title=Scheduled
-CTL_Issue_Due_Title=Due
-CTL_Issue_Estimate_Title=Estimate
-
-CTL_Issue_Product_Title=Product
-CTL_Issue_Product_Desc=Task Product
-CTL_Issue_Component_Title=Component
-CTL_Issue_Component_Desc=Task Component
-CTL_Issue_Version_Title=Version
-CTL_Issue_Version_Desc=Task Version
-CTL_Issue_OS_Title=OS
-CTL_Issue_OS_Desc=Task OS
-CTL_Issue_Platform_Title=Platform
-CTL_Issue_Platform_Desc=Task Platform
-CTL_Issue_Milestone_Title=Milestone
-CTL_Issue_Milestone_Desc=Task Milestone
-CTL_Issue_Reporter_Title=Reporter
-CTL_Issue_Reporter_Desc=Task Reporter
-CTL_Issue_Modification_Title=Modified
-CTL_Issue_Modification_Desc=Last time the task was modified
-CTL_Issue_QA_Contact_Title=QA Contact
-CTL_Issue_QA_Contact_Desc=Task QA Contact
-CTL_Issue_Keywords_Title=Keywords
-CTL_Issue_Keywords_Desc=Task Keywords
-CTL_Issue_Whiteboard_Title=Status Whiteboard
-CTL_Issue_Whiteboard_Desc=Task Status Whiteboard
-
-# IssuePanel
-IssuePanel.productLabel.text=Product:
-IssuePanel.componentLabel.text=Component:
-IssuePanel.versionLabel.text=Version:
-IssuePanel.platformLabel.text=Platform:
-IssuePanel.statusLabel.text=Status:
-IssuePanel.resolutionLabel.text=Resolution:
-IssuePanel.priorityLabel.text=Priority:
-IssuePanel.targetMilestoneLabel.text=Target Milestone:
-IssuePanel.urlLabel.text=URL:
-IssuePanel.keywordsLabel.text=Keywords:
-IssuePanel.reportedLabel.text=Reported:
-# {0} creation, {1} reporter
-IssuePanel.reportedLabel.format={0} by {1}
-IssuePanel.modifiedLabel.text=Modified:
-IssuePanel.assignedLabel.text=Assigned to:
-IssuePanel.qaContactLabel.text=QA Contact:
-IssuePanel.ccLabel.text=CC:
-IssuePanel.dependsLabel.text=Depends on:
-IssuePanel.blocksLabel.text=Blocks:
-IssuePanel.submitButton.text.new=Submit Task
-IssuePanel.attachmentsLabel.text=Attachments ({0})
-# {0} id, {1} summary
-IssuePanel.headerLabel.format=Task #{0} - {1}
-# {0} id
-IssuePanel.submitMessage=Submitting changes to task {0}
-IssuePanel.submitNewMessage=Submitting new task
-IssuePanel.refreshButton.text=Refresh
-IssuePanel.refreshMessage=Refreshing task {0}
-
-IssuePanel.duplicateLabel.text=of Task
-IssuePanel.keywordsButton.text=...
-IssuePanel.keywordsButton.message=Select or deselect task keywords.
-IssuePanel.blocksButton.text=...
-IssuePanel.blocksButton.message=&Select task that this task blocks.
-IssuePanel.dependsOnButton.text=...
-IssuePanel.dependsOnButton.message=&Select task that this task depends on.
-IssuePanel.duplicateButton.text=...
-IssuePanel.duplicateButton.message=&Select the duplicate task.
-IssuePanel.summaryLabel.text=Summary:
-IssuePanel.description=Description
-IssuePanel.noSummary=Missing summary.
-IssuePanel.noComponent=Missing component.
-IssuePanel.noTargetMilestone=Missing target milestone.
-IssuePanel.noVersion=Missing version.
-IssuePanel.noReproducibility=Missing reproducibility.
-IssuePanel.cyclicDependency=This task cannot block and depend on the same task.
-IssuePanel.commentAddedWarning=Someone added a comment while you were editing this task. Read it below.
-IssuePanel.invalidKeyword=Keywords field contains non-existing keyword(s).
-IssuePanel.noDuplicateId=Duplicate of Task field contains no task id.
-IssuePanel.reloadMessage=Reloading server attributes
-IssuePanel.refreshButton.toolTipText=Load the latest task data from the server.
-IssuePanel.tasklistButton.add=Add to Category
-IssuePanel.statusWhiteboardLabel.text=Status Whiteboard:
-IssuePanel.issueTypeLabel.text=Task Type:
-
-# IssuePanel - A11Y
-IssuePanel.productCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.productField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.componentCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.versionCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.platformCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.osCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.statusCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.resolutionCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.resolutionField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.priorityCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.severityCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.targetMilestoneCombo.AccessibleContext.accessibleDescription=N/A
-IssuePanel.urlField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.keywordsField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.keywordsButton.AccessibleContext.accessibleDescription=Opens keywords chooser
-IssuePanel.reportedField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.modifiedField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.assignedField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.qaContactField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.ccField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.duplicateField.AccessibleContext.accessibleDescription=Number of duplicate task
-IssuePanel.duplicateButton.AccessibleContext.accessibleDescription=Opens task chooser
-IssuePanel.dependsField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.dependsOnButton.AccessibleContext.accessibleDescription=Opens task chooser
-IssuePanel.blocksField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.blocksButton.AccessibleContext.accessibleDescription=Opens task chooser
-IssuePanel.refreshButton.AccessibleContext.accessibleDescription=N/A
-IssuePanel.summaryField.AccessibleContext.accessibleDescription=N/A
-IssuePanel.addCommentArea.AccessibleContext.accessibleDescription=
-IssuePanel.viewLogButton.text=(review IDE Log)
-# {0} NB version {1} OS name {2} OS version {3} OS arch
-# {4} Java version {5} java.vm.name {6} java.vm.version
-IssuePanel.newIssue.netbeansInfo=Product Version = {0}\n\
-Operating System = {1} version {2} running on {3}\n\
-Java; VM; Vendor = {4}\n\
-Runtime = {5} {6}
-
-IssuePanel.newIssue.netbeansDescTemplate=STEPS:\n * Open dialog Foo\n * Click on button "Click me"\n\nACTUAL:\n nothing happens\n\nEXPECTED:\n message pops up
-
-# CommentsPanel
-# {0} author
-CommentsPanel.leftLabel.format={0} - Task Description
-CommentsPanel.leftLabel.text=Comment
-Comments.replyButton.text=Reply
-CommentsPanel.textPane.AccessibleContext.accessibleName=Comment or description
-CommentsPanel.textPane.AccessibleContext.accessibleDescription=Comment or description of the task
-CommentsPanel.replyButton.AccessibleContext.accessibleDescription=Reply to the comment
-CommentsPanel.mailtoButton.text=Mail to
-CommentsPanel.mailtoButton.AccessibleContext.accessibleDescription=Email the author
-
-LBL_NEW_STATUS=New
-LBL_SUMMARY_CHANGED_STATUS=Summary changed
-## CC is a bugzilla attributes name, do not translate
-LBL_CC_FIELD_CHANGED_STATUS=CC field changed
-LBL_KEYWORDS_CHANGED_STATUS=Keywords changed
-LBL_DEPENDENCE_CHANGED_STATUS=Dependence changed
-LBL_CHANGED_TO={0} changed to {1}
-LBL_CHANGES_INCL_SUMMARY= {0} changes, incl. summary
-LBL_CHANGES_INCL_PRIORITY= {0} changes, incl. priority
-LBL_CHANGES_INCL_SEVERITY= {0} changes, incl. severity
-LBL_CHANGES_INCL_ISSUE_TYPE= {0} changes, incl. task type
-LBL_CHANGES_INCL_PRODUCT= {0} changes, incl. product
-LBL_CHANGES_INCL_COMPONENT= {0} changes, incl. component
-LBL_CHANGES_INCL_PLATFORM= {0} changes, incl. platform
-LBL_CHANGES_INCL_VERSION= {0} changes, incl. version
-LBL_CHANGES_INCL_MILESTONE= {0} changes, incl. milestone
-LBL_CHANGES_INCL_KEYWORDS= {0} changes, incl. keywords
-LBL_CHANGES_INCL_URL= {0} changes, incl. url
-LBL_CHANGES_INCL_ASSIGNEE= {0} changes, incl. Assignee
-LBL_CHANGES_INCL_QA_CONTACT= {0} changes, incl. qa contact
-LBL_CHANGES_INCLUSIVE_DEPENDENCE= {0} changes, inclusive dependence
-LBL_CHANGES={0} changes
-LBL_COMMENTS_CHANGED={0} new comment(s)
-LBL_ATTACHMENTS_CHANGED=Attachment(s) added
-
-Attachment.open.progress=Opening attachment {0}
-Attachment.saveToFile.progress=Saving attachment {0}
-Attachment.applyPatch.progress=Applying patch {0}
-
-BugzillaIssueProvider.loadingIssue = Loading task...
-BugzillaIssueProvider.resolveAction=Resolve...
-BugzillaIssueProvider.resolveIssueButton.text=Resolve Task
-BugzillaIssueProvider.resolveIssueMessage=Resolving task {0}
-BugzillaIssueProvider.resolveAction.notPermitted=Resolve action is not permitted\nTask is already closed.
-ResolveIssuePanel.resolutionLabel.text=&Resolution:
-ResolveIssuePanel.commentLabel.text=Co&mment:
-ResolveIssuePanel.duplicateButton.text=...
-ResolveIssuePanel.resolveButton=&Resolve
-ResolveIssuePanel.resolutionCombo.AccessibleContext.accessibleDescription=N/A
-ResolveIssuePanel.duplicateField.AccessibleContext.accessibleDescription=Number of duplicate task
-ResolveIssuePanel.duplicateButton.AccessibleContext.accessibleDescription=Opens task chooser
-ResolveIssuePanel.textArea.AccessibleContext.accessibleDescription=N/A
-ResolveIssuePanel.duplicateLabel.text=of &Task
-IssuePanel.showInBrowserButton.text=Show in Browser
-IssuePanel.assignToDefaultCheckBox.text=Reassign to Default
-
-LBL_CollapseAll=Collapse all
-LBL_ExpandAll=Expand all
-IssuePanel.jLabel7.text=+
-IssuePanel.estimatedField.text=0.0
-IssuePanel.estimatedLabel.text=Original Est.
-IssuePanel.actualLabel.text=Current Est.
-IssuePanel.actualField.text=0.0
-IssuePanel.workedLabel.text=Hours Worked
-IssuePanel.workedField.text=0.0
-IssuePanel.remainingField.text=0.0
-IssuePanel.remainingLabel.text=Hours Left
-IssuePanel.completeLabel.text=% Complete
-IssuePanel.completeField.text=0
-IssuePanel.gainField.text=0
-IssuePanel.gainLabel.text=Gain
-IssuePanel.deadlineLabel.text=Deadline
-IssuePanel.workedSumField.text=0
-IssuePanel.timetrackingLabel.text=Timetracking:
-IssuePanel.attachLogCheckBox.text=Attach IDE Log
-
-IssuePanel.btnDeleteTask.TTtext=Dismiss the new task, delete it and forget all changes made to its fields
-
-LBL_Type=Type
-LBL_Assigned=Assignee
-LBL_ConflictShort=Conflict - your unsubmitted changes conflict with remote changes
-LBL_UnsubmittedShort=Unsubmitted - contains unsubmitted changes
-LBL_UnsubmittedNewShort=Unsubmitted New - newly created task, not yet submitted
-LBL_RemoteShort=Incoming - contains remote changes
-LBL_RemoteNewShort=Incoming New - new task created in repository
-IssuePanel.attributesSection.label=Attributes
-IssuePanel.commentsLabel.text=Comments ({0})
-IssuePanel.newCommentSection.label=New Comment
-IssuePanel.submitButton.AccessibleContext.accessibleDescription=N/A
-IssuePanel.cancelButton.AccessibleContext.accessibleDescription=N/A
-IssuePanel.cancelButton.text=Cancel
-IssuePanel.submitButton.text=Submit
-IssuePanel.btnDeleteTask.text=Dismiss
-IssuePanel.notesLabel.text=Notes:
-IssuePanel.estimateLabel.text=Estimate:
-IssuePanel.scheduleDateLabel.text=Schedule Date:
-IssuePanel.dueDateLabel.text=Due Date:
-IssuePanel.estimateField.toolTipText=
-IssuePanel.dueDateLabel.TTtext=Set task's due date
-IssuePanel.scheduleDateLabel.TTtext=Set task's schedule date
-IssuePanel.notesLabel.TTtext=Task's private notes
-IssuePanel.estimateLabel.TTtext=Set task's estimate in hours
-IssuePanel.privateAttributesSection.text=My Private Task Details
-IssuePanel.privateAttributesSection.containsNotes=Contains notes
-IssuePanel.reproducibilityLabel.text=Reproducibility:
-IssuePanel.reproducibilityCommitText=Reproducibility: {0}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java
deleted file mode 100644
index 07523f97f2a6..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/CommentsPanel.java
+++ /dev/null
@@ -1,592 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.issue;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Point;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.MouseEvent;
-import java.awt.event.MouseListener;
-import java.text.DateFormat;
-import java.text.MessageFormat;
-import java.text.ParseException;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ResourceBundle;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import javax.swing.AbstractAction;
-import javax.swing.Action;
-import javax.swing.BorderFactory;
-import javax.swing.GroupLayout;
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JMenuItem;
-import javax.swing.JPanel;
-import javax.swing.JPopupMenu;
-import javax.swing.JScrollPane;
-import javax.swing.JTextPane;
-import javax.swing.LayoutStyle;
-import javax.swing.JTree;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.plaf.basic.BasicTextPaneUI;
-import javax.swing.plaf.basic.BasicTreeUI;
-import javax.swing.text.Caret;
-import javax.swing.text.DefaultCaret;
-import javax.swing.text.Element;
-import javax.swing.text.StyledDocument;
-import org.netbeans.modules.bugtracking.commons.IssueSettingsStorage;
-import org.netbeans.modules.bugtracking.commons.HyperlinkSupport;
-import org.netbeans.modules.bugtracking.commons.LinkButton;
-import org.netbeans.modules.bugtracking.commons.UIUtils;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.repository.IssueField;
-import org.openide.util.NbBundle;
-import org.openide.util.RequestProcessor;
-
-/**
- *
- * @author Jan Stola
- */
-public class CommentsPanel extends JPanel {
- static final RequestProcessor RP = new RequestProcessor("Bugzilla Comments Panel", 5, false); // NOI18N
- private static final DateFormat dateTimeFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm"); // NOI18N
- private static final String REPLY_TO_PROPERTY = "replyTo"; // NOI18N
- private static final String QUOTE_PREFIX = "> "; // NOI18N
- private static final int MAX_COMMENT_HEIGHT = 10000;
-
- private static Color blueBackground = null;
- private static Color greyForeground = null;
-
- private final JPopupMenu commentsPopup = new PopupMenu();
- private BugzillaIssue issue;
- private List attachments;
- private List attachmentIds;
- private NewCommentHandler newCommentHandler;
-
- private Set collapsedComments = Collections.synchronizedSet(new HashSet());
-
- static {
- blueBackground = UIManager.getColor( "nb.bugtracking.comment.background" ); //NOI18N
- if( null == blueBackground )
- blueBackground = new Color(0xf3f6fd);
- greyForeground = UIManager.getColor( "nb.bugtracking.comment.foreground" ); //NOI18N
- if( null == greyForeground )
- greyForeground = new Color(0x999999);
- }
- private ArrayList sections;
-
- public CommentsPanel() {
- setOpaque( false );
- }
-
- void setIssue(BugzillaIssue issue,
- List attachments) {
- removeAll();
- this.issue = issue;
- initCollapsedComments();
- this.attachments = attachments;
- this.attachmentIds = getAttachmentIds(attachments);
- BugzillaIssue.Comment[] comments = issue.getComments();
- this.sections = new ArrayList<>(comments.length + 1);
- GroupLayout layout = new GroupLayout(this);
- GroupLayout.ParallelGroup horizontalGroup = layout.createParallelGroup(GroupLayout.Alignment.LEADING);
- layout.setHorizontalGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(horizontalGroup)
- .addContainerGap());
- GroupLayout.SequentialGroup verticalGroup = layout.createSequentialGroup();
- verticalGroup.addContainerGap();
- layout.setVerticalGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING).addGroup(verticalGroup));
- DateFormat format = DateFormat.getDateTimeInstance(DateFormat.DEFAULT, DateFormat.SHORT);
- String creationTxt = issue.getFieldValue(IssueField.CREATION);
- try {
- if (!creationTxt.isEmpty()) {
- Date creation = dateTimeFormat.parse(creationTxt);
- creationTxt = format.format(creation);
- }
- } catch (ParseException pex) {
- Bugzilla.LOG.log(Level.INFO, null, pex);
- }
- sections.add(addSection(layout, Long.valueOf(0),
- issue.getFieldValue(IssueField.DESCRIPTION),
- issue.getFieldValue(IssueField.REPORTER),
- issue.getFieldValue(IssueField.REPORTER_NAME),
- creationTxt, horizontalGroup, verticalGroup, true));
- for (BugzillaIssue.Comment comment : comments) {
- String when = format.format(comment.getWhen());
- sections.add(addSection(layout, comment.getNumber(), comment.getText(), comment.getAuthor(), comment.getAuthorName(), when, horizontalGroup, verticalGroup, false));
- }
- verticalGroup.addContainerGap();
- setLayout(layout);
- }
-
- private static List getAttachmentIds(
- List attachments) {
- if (attachments.isEmpty()) {
- return Collections.emptyList();
- }
-
- List result = new ArrayList(attachments.size());
- for (BugzillaIssue.Attachment attachment : attachments) {
- result.add(attachment.getId());
- }
- return result;
- }
-
- public void setNewCommentHandler(NewCommentHandler handler) {
- newCommentHandler = handler;
- }
-
- private ExpandLabel addSection(GroupLayout layout, final Long number, String text, final String author, String authorName, String dateTimeString,
- GroupLayout.ParallelGroup horizontalGroup, GroupLayout.SequentialGroup verticalGroup, boolean description) {
-
- JTextPane textPane = new JTextPane();
- setupTextPane(textPane, text);
-
- JPanel headerPanel = new JPanel();
- headerPanel.setOpaque( false );
- JPanel placeholder = createTextPanelPlaceholder();
- JLabel commentLabel = new JLabel();
- JLabel rightLabel = new JLabel();
- ExpandLabel iconLabel = new ExpandLabel(placeholder, textPane, headerPanel, commentLabel, number);
- JLabel leftLabel = new JLabel();
-
- headerPanel.addMouseListener(iconLabel);
- headerPanel.setComponentPopupMenu(expandPopup);
-
- // left label
- ResourceBundle bundle = NbBundle.getBundle(CommentsPanel.class);
- String leftTxt = "";
- String authorTxt = ((authorName != null) && (authorName.trim().length() > 0)) ? authorName : author;
- if (description) {
- String leftFormat = bundle.getString("CommentsPanel.leftLabel.format"); // NOI18N
- leftTxt = MessageFormat.format(leftFormat, authorTxt);
- } else {
- leftTxt = authorTxt;
- }
- leftLabel.setText(leftTxt);
- leftLabel.setLabelFor(textPane);
- leftLabel.setForeground(greyForeground);
- leftLabel.setOpaque(false);
- leftLabel.addMouseListener(iconLabel);
- leftLabel.setComponentPopupMenu(expandPopup);
-
- // comment label
- commentLabel.setOpaque(false);
- commentLabel.addMouseListener(iconLabel);
- commentLabel.setComponentPopupMenu(expandPopup);
-
- // right label
- rightLabel.setText(dateTimeString);
- rightLabel.setForeground(greyForeground);
- rightLabel.setOpaque(false);
- rightLabel.addMouseListener(iconLabel);
- rightLabel.setComponentPopupMenu(expandPopup);
-
- // state label
- JLabel stateLabel = null;
-
- // replay button
- LinkButton replyButton = new LinkButton(bundle.getString("Comments.replyButton.text")); // NOI18N
- replyButton.addActionListener(getReplyListener());
- replyButton.putClientProperty(REPLY_TO_PROPERTY, textPane);
- replyButton.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.replyButton.AccessibleContext.accessibleDescription")); // NOI18N
- replyButton.setOpaque(false);
-
- // mailto button
- LinkButton.MailtoButton mailtoButton = null;
- if(author.indexOf("@") > -1) {
- mailtoButton = new LinkButton.MailtoButton(
- NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.mailtoButton.text"), // NOI18N
- NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.mailtoButton.AccessibleContext.accessibleDescription"), // NOI18N
- author,
- NbBundle.getMessage(CommentsPanel.class, "IssuePanel.headerLabel.format", new Object[] {issue.getID(), issue.getSummary()}), // subject NOI18N
- getReplayText(text)); // body
- replyButton.setOpaque(false);
- }
- // IssueProvider 172653 - JTextPane too big
- JComponent pane = textPane;
- if (textPane.getPreferredSize().height>Short.MAX_VALUE) {
- pane = new JScrollPane(textPane);
- Dimension dim = new Dimension(textPane.getPreferredSize());
- dim.height = MAX_COMMENT_HEIGHT;
- pane.setPreferredSize(dim);
- }
-
- // Layout
- layoutHeaderPanel(headerPanel, iconLabel, leftLabel, commentLabel, rightLabel, replyButton, mailtoButton, stateLabel);
-
- iconLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
- placeholder.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
- leftLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
- commentLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
- rightLabel.setBorder(BorderFactory.createEmptyBorder(1,1,1,1));
-
- horizontalGroup
- .addComponent(headerPanel)
- .addGroup(layout.createSequentialGroup()
- .addComponent(placeholder, GroupLayout.PREFERRED_SIZE, GroupLayout.DEFAULT_SIZE, GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0)
- .addComponent(pane));
-
- if (!description) {
- verticalGroup.addPreferredGap(LayoutStyle.ComponentPlacement.UNRELATED);
- }
- verticalGroup
- .addComponent(headerPanel)
- .addGroup(layout.createParallelGroup(GroupLayout.Alignment.LEADING, false)
- .addComponent(placeholder)
- .addComponent(pane, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE));
- return iconLabel;
- }
-
- private void setupTextPane(final JTextPane textPane, String comment) {
- if( UIUtils.isNimbus() ) {
- textPane.setUI( new BasicTextPaneUI() );
- }
- textPane.setText(comment);
-
- Caret caret = textPane.getCaret();
- if (caret instanceof DefaultCaret) {
- ((DefaultCaret)caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
- }
-
- // attachments
- if (!attachmentIds.isEmpty()) {
- AttachmentHyperlinkSupport.Attachement a = AttachmentHyperlinkSupport.findAttachment(comment, attachmentIds);
- if (a != null) {
- String attachmentId = a.id;
- if (attachmentId != null) {
- int index = attachmentIds.indexOf(attachmentId);
- if (index != -1) {
- BugzillaIssue.Attachment attachment = attachments.get(index);
- AttachmentLink attachmentLink = new AttachmentLink(attachment);
- HyperlinkSupport.getInstance().registerLink(textPane, new int[] {a.idx1, a.idx2}, attachmentLink);
- } else {
- Bugzilla.LOG.log(Level.WARNING, "couldn''t find attachment id in: {0}", comment); // NOI18N
- }
- }
- }
- }
-
- // pop-ups
- textPane.setComponentPopupMenu(commentsPopup);
-
- textPane.setBackground(blueBackground);
-
- textPane.setBorder(BorderFactory.createEmptyBorder(3,3,3,3));
- textPane.setEditable(false);
- textPane.getAccessibleContext().setAccessibleName(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.textPane.AccessibleContext.accessibleName")); // NOI18N
- textPane.getAccessibleContext().setAccessibleDescription(NbBundle.getMessage(CommentsPanel.class, "CommentsPanel.textPane.AccessibleContext.accessibleDescription")); // NOI18N
- }
-
- private void layoutHeaderPanel(JPanel headerPanel, JLabel iconLabel, JLabel leftLabel, JLabel commentLabel, JLabel rightLabel, LinkButton replyButton, LinkButton mailtoButton, JLabel stateLabel) {
- GroupLayout layout = new GroupLayout(headerPanel);
- headerPanel.setLayout(layout);
- GroupLayout.SequentialGroup hGroup = layout.createSequentialGroup()
- .addComponent(iconLabel)
- .addComponent(leftLabel);
- if (stateLabel != null) {
- hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(stateLabel);
- }
- hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(commentLabel,0, 0, Short.MAX_VALUE)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(rightLabel)
- .addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(replyButton);
- if (mailtoButton != null) {
- hGroup.addPreferredGap(LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(mailtoButton);
- }
- layout.setHorizontalGroup(hGroup);
-
- GroupLayout.ParallelGroup vGroup = layout.createParallelGroup(GroupLayout.Alignment.BASELINE)
- .addComponent(iconLabel)
- .addComponent(leftLabel);
- if (stateLabel != null) {
- vGroup.addComponent(stateLabel);
- }
- vGroup.addComponent(commentLabel)
- .addComponent(rightLabel)
- .addComponent(replyButton);
- if (mailtoButton != null) {
- vGroup.addComponent(mailtoButton);
- }
- layout.setVerticalGroup(vGroup);
- }
-
- private ActionListener replyListener;
- private ActionListener getReplyListener() {
- if (replyListener == null) {
- replyListener = new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- Object source = e.getSource();
- if (source instanceof JComponent) {
- JComponent comp = (JComponent)source;
- Object value = comp.getClientProperty(REPLY_TO_PROPERTY);
- if (value instanceof JTextPane) {
- JTextPane pane = (JTextPane)value;
- newCommentHandler.append(getReplayText(pane.getText()));
- }
- }
- }
-
- };
- }
- return replyListener;
- }
-
- private String getReplayText(String text) {
- StringBuilder sb = new StringBuilder();
- StringTokenizer tokenizer = new StringTokenizer(text, "\n"); // NOI18N
- while (tokenizer.hasMoreElements()) {
- String line = tokenizer.nextToken();
- sb.append(QUOTE_PREFIX).append(line).append('\n'); // NOI18N
- }
- return sb.toString();
- }
-
- private JPanel createTextPanelPlaceholder() {
- JPanel placeholder = new JPanel();
- placeholder.setBackground(blueBackground);
- GroupLayout layout = new GroupLayout(placeholder);
- placeholder.setLayout(layout);
- layout.setHorizontalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, ICON_WIDTH, Short.MAX_VALUE));
- layout.setVerticalGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING).addGap(0, 0, Short.MAX_VALUE));
- return placeholder;
- }
-
- void collapseAll () {
- for (ExpandLabel lbl : sections) {
- lbl.setState(true);
- }
- }
-
- void expandAll () {
- for (ExpandLabel lbl : sections) {
- lbl.setState(false);
- }
- }
-
- class PopupMenu extends JPopupMenu {
-
- /*
- * Holds the location of where the user invoked the pop-up menu.
- * It must be remembered before calling super.show(...) because
- * the method show() may change the location of the pop-up menu,
- * so the original location might not be available.
- */
- private final Point clickPoint = new Point();
-
- @Override
- public void show(Component invoker, int x, int y) {
- clickPoint.setLocation(x, y);
- super.show(invoker, x, y);
- }
-
- @Override
- public void setVisible(boolean b) {
- if (b) {
- JTextPane pane = (JTextPane) getInvoker();
- StyledDocument doc = pane.getStyledDocument();
- Element elem = doc.getCharacterElement(pane.viewToModel(clickPoint));
- Object l = elem.getAttributes().getAttribute(HyperlinkSupport.LINK_ATTRIBUTE);
- if (l instanceof AttachmentLink) {
- BugzillaIssue.Attachment attachment = ((AttachmentLink) l).attachment;
- if (attachment != null) {
- add(new JMenuItem(attachment.getOpenAction()));
- add(new JMenuItem(attachment.getSaveAction()));
- Action openInStackAnalyzerAction = attachment.getOpenInStackAnalyzerAction();
- if(openInStackAnalyzerAction != null) {
- add(new JMenuItem(openInStackAnalyzerAction));
- }
- if (attachment.isPatch()) {
- Action a = attachment.getApplyPatchAction();
- if(a != null) {
- add(attachment.getApplyPatchAction());
- }
- }
- super.setVisible(true);
- }
- }
- } else {
- super.setVisible(false);
- removeAll();
- }
- }
-
- }
-
- public interface NewCommentHandler {
- void append(String text);
- }
-
- private final JPopupMenu expandPopup = new ExpandPopupMenu();
- private Set expandLabels = new HashSet();
-
- private class ExpandPopupMenu extends JPopupMenu {
- public ExpandPopupMenu() {
- add(new JMenuItem(new AbstractAction(NbBundle.getMessage(CommentsPanel.class, "LBL_ExpandAll")) { // NOI18N
- @Override
- public void actionPerformed(ActionEvent e) {
- for (ExpandLabel l : expandLabels) {
- l.setState(false);
- }
- }
- }));
- add(new JMenuItem(new AbstractAction(NbBundle.getMessage(CommentsPanel.class, "LBL_CollapseAll")) { // NOI18N
- @Override
- public void actionPerformed(ActionEvent e) {
- for (ExpandLabel l : expandLabels) {
- l.setState(true);
- }
- }
- }));
- }
- }
-
- private void commentCollapsed(Long number) {
- collapsedComments.add(number);
- }
-
- private Set touchedCommenst = Collections.synchronizedSet(new HashSet());
- private void commentExpanded(Long number) {
- if(collapsedComments.remove(number)) {
- touchedCommenst.add(number);
- }
- }
-
- private boolean isCollapsed(Long number) {
- return collapsedComments.contains(number);
- }
-
- private void initCollapsedComments() {
- RP.post(new Runnable() {
- @Override
- public void run() {
- Collection s = IssueSettingsStorage.getInstance().loadCollapsedCommenst(issue.getRepository().getUrl(), issue.getID());
- for (Long l : s) {
- if(!touchedCommenst.contains(l)) {
- collapsedComments.add(l);
- }
- }
- }
- });
- }
-
- void storeSettings() {
- if(issue != null) {
- IssueSettingsStorage.getInstance().storeCollapsedComments(collapsedComments, issue.getRepository().getUrl(), issue.getID());
- }
- }
-
- private static final Icon ei;
- private static final Icon ci;
- private static final int ICON_WIDTH;
- static {
- JTree tv = new JTree();
- BasicTreeUI tvui = (BasicTreeUI) tv.getUI();
- ei = tvui.getExpandedIcon();
- ci = tvui.getCollapsedIcon();
- ICON_WIDTH = ei != null ? ei.getIconWidth() : 16;
- }
- private class ExpandLabel extends JLabel implements MouseListener {
- private final JTextPane textPane;
- private final JPanel headerPanel;
- private final JPanel placeholderPanel;
- private final JLabel commentLabel;
- private final Long number;
-
- public ExpandLabel(JPanel placeholderPanel, JTextPane textPane, JPanel headerPanel, JLabel commentLabel, Long number) {
- this.textPane = textPane;
- this.headerPanel = headerPanel;
- this.placeholderPanel = placeholderPanel;
- this.commentLabel = commentLabel;
- this.number = number;
-
-
- addMouseListener(this);
- setComponentPopupMenu(expandPopup);
- setState(isCollapsed(number));
- expandLabels.add(this);
- }
-
- @Override
- public void mouseClicked(MouseEvent e) {
- if (SwingUtilities.isLeftMouseButton(e)) {
- setState(!isCollapsed(number));
- }
- }
-
- @Override
- public void mousePressed(MouseEvent e) {}
- @Override
- public void mouseReleased(MouseEvent e) {}
- @Override
- public void mouseEntered(MouseEvent e) {}
- @Override
- public void mouseExited(MouseEvent e) {}
-
- private void setState(boolean collapsed) {
- if(collapsed) {
- textPane.setVisible(false);
- placeholderPanel.setVisible(false);
- commentLabel.setText(textPane.getText().replace("\n", " ").replace("\t", " ")); // NOI18N
- setIcon(ci);
- headerPanel.setBackground(blueBackground);
- headerPanel.setOpaque( true );
- commentCollapsed(number);
- } else {
- textPane.setVisible(true);
- placeholderPanel.setVisible(true);
- commentLabel.setText("");
- setIcon(ei);
- headerPanel.setOpaque( false );
- commentExpanded(number);
- }
- }
- }
-
- private class AttachmentLink implements HyperlinkSupport.Link {
- private BugzillaIssue.Attachment attachment;
- public AttachmentLink(BugzillaIssue.Attachment attachment) {
- this.attachment = attachment;
- }
- @Override
- public void onClick(String linkText) {
- attachment.open();
- }
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form
deleted file mode 100644
index f7d54c1d9ad0..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.form
+++ /dev/null
@@ -1,1967 +0,0 @@
-
-
-
-
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java
deleted file mode 100644
index fbdf0e4c7324..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/IssuePanel.java
+++ /dev/null
@@ -1,4542 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.issue;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Container;
-import java.awt.Dimension;
-import java.awt.EventQueue;
-import java.awt.Font;
-import java.awt.Insets;
-import java.awt.Point;
-import java.awt.Rectangle;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.KeyEvent;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.DateFormat;
-import java.text.MessageFormat;
-import java.text.ParseException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashMap;
-import java.util.LinkedHashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.Set;
-import java.util.StringTokenizer;
-import java.util.logging.Level;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import javax.swing.AbstractAction;
-import javax.swing.AbstractButton;
-import javax.swing.Action;
-import javax.swing.ActionMap;
-import javax.swing.ComboBoxModel;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.GroupLayout;
-import javax.swing.ImageIcon;
-import javax.swing.InputMap;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JOptionPane;
-import javax.swing.JScrollPane;
-import javax.swing.JTextArea;
-import javax.swing.JTextField;
-import javax.swing.KeyStroke;
-import javax.swing.LayoutStyle;
-import javax.swing.ListModel;
-import javax.swing.SwingConstants;
-import javax.swing.SwingUtilities;
-import javax.swing.UIManager;
-import javax.swing.event.CaretEvent;
-import javax.swing.event.CaretListener;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import javax.swing.plaf.basic.BasicTextFieldUI;
-import javax.swing.text.BadLocationException;
-import javax.swing.text.Caret;
-import javax.swing.text.DefaultCaret;
-import javax.swing.text.JTextComponent;
-import javax.swing.text.NumberFormatter;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
-import org.netbeans.api.progress.ProgressHandle;
-import org.netbeans.api.progress.ProgressHandleFactory;
-import org.netbeans.modules.bugtracking.api.Issue;
-import org.netbeans.modules.bugtracking.api.IssueQuickSearch;
-import org.netbeans.modules.team.spi.OwnerInfo;
-import org.netbeans.modules.team.spi.RepositoryUser;
-import org.netbeans.modules.team.spi.RepositoryUserRenderer;
-import org.netbeans.modules.bugtracking.spi.IssueStatusProvider;
-import org.netbeans.modules.bugtracking.commons.AttachmentsPanel;
-import org.netbeans.modules.bugtracking.commons.LinkButton;
-import org.netbeans.modules.bugtracking.commons.NBBugzillaUtils;
-import org.netbeans.modules.bugtracking.commons.UIUtils;
-import org.netbeans.modules.bugtracking.spi.SchedulePicker;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.BugzillaConfig;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue.Attachment;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue.Comment;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugzilla.repository.CustomIssueField;
-import org.netbeans.modules.bugzilla.repository.IssueField;
-import org.netbeans.modules.bugzilla.util.BugzillaConstants;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.netbeans.modules.bugzilla.util.NbBugzillaConstants;
-import org.netbeans.modules.mylyn.util.NbDateRange;
-import org.netbeans.modules.spellchecker.api.Spellchecker;
-import org.netbeans.modules.team.ide.spi.IDEServices;
-import org.openide.awt.HtmlBrowser;
-import org.openide.filesystems.FileUtil;
-import org.openide.nodes.Node;
-import org.openide.util.HelpCtx;
-import org.openide.util.ImageUtilities;
-import org.openide.util.Mutex;
-import org.openide.util.NbBundle;
-import org.openide.util.Pair;
-import org.openide.util.RequestProcessor;
-import org.openide.windows.TopComponent;
-import org.openide.windows.WindowManager;
-
-/**
- * Panel showing (and allowing to edit) details of an issue.
- *
- * @author Jan Stola
- */
-@NbBundle.Messages({
- "LBL_Duplicate.fieldName=Duplicate of"
-})
-public class IssuePanel extends javax.swing.JPanel {
- private static Color incomingChangesColor = null;
- private static final RequestProcessor RP = new RequestProcessor("Bugzilla Issue Panel", 5, false); // NOI18N
- private static final URL ICON_REMOTE_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/remote.png"); //NOI18N
- private static final ImageIcon ICON_REMOTE = ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/remote.png", true); //NOI18N
- private static final URL ICON_CONFLICT_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/conflict.png"); //NOI18N
- private static final ImageIcon ICON_CONFLICT = ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/conflict.png", true); //NOI18N
- private static final URL ICON_UNSUBMITTED_PATH = IssuePanel.class.getClassLoader().getResource("org/netbeans/modules/bugzilla/resources/unsubmitted.png"); //NOI18N
- private static final ImageIcon ICON_UNSUBMITTED = ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/unsubmitted.png", true); //NOI18N
- private static final String SECTION_ATTRIBUTES = ".attributes"; //NOI18N
- private static final String SECTION_ATTACHMENTS = ".attachments"; //NOI18N
- private static final String SECTION_COMMENTS = ".comments"; //NOI18N
- private static final String SECTION_PRIVATE = ".private"; //NOI18N
- private static final String ATTRIBUTE_PRIVATE_NOTES = "nb.private.notes"; //NOI18N
- private static final String ATTRIBUTE_ESTIMATE = "nb.estimate"; //NOI18N
- private static final String ATTRIBUTE_DUE_DATE = "nb.due.date"; //NOI18N
- private static final String ATTRIBUTE_SCHEDULE_DATE = "nb.schedule.date"; //NOI18N
- private BugzillaIssue issue;
- private CommentsPanel commentsPanel;
- private AttachmentsPanel attachmentsPanel;
- private int resolvedIndex;
- private List keywords = new LinkedList<>();
- private boolean reloading;
- private boolean skipReload;
- private boolean usingTargetMilestones;
- private OwnerInfo ownerInfo;
- private final Set unsavedFields = new HashSet<>();
- private boolean customFieldsLoaded;
-
- static {
- incomingChangesColor = UIManager.getColor( "nb.bugtracking.label.highlight" ); //NOI18N
- if( null == incomingChangesColor ) {
- incomingChangesColor = new Color(217, 255, 217);
- }
- }
- private boolean initializingNewTask;
- private Action[] attributesSectionActions;
- private Action[] attachmentsSectionActions;
- private Action[] commentsSectionActions;
- private Action[] privateSectionActions;
- private final IDEServices.DatePickerComponent dueDatePicker;
- private final IDEServices.DatePickerComponent deadlinePicker;
- private final SchedulePicker scheduleDatePicker;
- private static final NumberFormatter estimateFormatter = new NumberFormatter(new java.text.DecimalFormat("#0")) {
-
- @Override
- public Object stringToValue (String text) throws ParseException {
- Number value = (Number) super.stringToValue(text);
- if (value == null) {
- value = 0;
- }
- if (value.intValue() < 0) {
- return 0;
- } else {
- return value.intValue();
- }
- }
-
- };
- private boolean opened;
-
- public IssuePanel() {
- initComponents();
- updateReadOnlyField(reportedField);
- updateReadOnlyField(modifiedField);
- updateReadOnlyField(resolutionField);
- updateReadOnlyField(productField);
- updateReadOnlyField(headerField);
- messagePanel.setBackground(getBackground());
- customFieldsPanelLeft.setBackground(getBackground());
- customFieldsPanelRight.setBackground(getBackground());
- Font font = reportedLabel.getFont();
- headerField.setFont(font.deriveFont((float)(font.getSize()*1.7)));
- duplicateLabel.setVisible(false);
- duplicateWarning.setVisible(false);
- duplicateField.setVisible(false);
- duplicateButton.setVisible(false);
- attachDocumentListeners();
- attachHideStatusListener();
- addCommentArea.addCaretListener(new CaretListener() {
- @Override
- public void caretUpdate(CaretEvent e) {
- makeCaretVisible(addCommentArea);
- }
- });
-
- // A11Y - Issues 163597 and 163598
- UIUtils.fixFocusTraversalKeys(addCommentArea);
-
- // Comments panel
- commentsPanel = new CommentsPanel();
- commentsPanel.setNewCommentHandler(new CommentsPanel.NewCommentHandler() {
- @Override
- public void append(String text) {
- addCommentArea.append(text);
- addCommentArea.requestFocus();
- scrollRectToVisible(scrollPane1.getBounds());
- }
- });
- attachmentsPanel = new AttachmentsPanel(this);
- ((GroupLayout) commentsSectionPanel.getLayout()).replace(dummyCommentsPanel, commentsPanel);
- ((GroupLayout) attributesSectionPanel.getLayout()).replace(dummyTimetrackingPanel, timetrackingPanel);
- ((GroupLayout) attachmentsSectionPanel.getLayout()).replace(dummyAttachmentsPanel, attachmentsPanel);
- deadlinePicker = UIUtils.createDatePickerComponent();
- ((GroupLayout) timetrackingPanel.getLayout()).replace(dummyDeadlineField, deadlinePicker.getComponent());
- GroupLayout layout = (GroupLayout) privatePanel.getLayout();
- dueDatePicker = UIUtils.createDatePickerComponent();
- scheduleDatePicker = new SchedulePicker();
- layout.replace(dummyDueDateField, dueDatePicker.getComponent());
- dueDateLabel.setLabelFor(dueDatePicker.getComponent());
- layout.replace(dummyScheduleDateField, scheduleDatePicker.getComponent());
- scheduleDateLabel.setLabelFor(scheduleDatePicker.getComponent());
- privateNotesField.addCaretListener(new CaretListener() {
- @Override
- public void caretUpdate (CaretEvent e) {
- makeCaretVisible(privateNotesField);
- }
- });
- // A11Y - Issues 163597 and 163598
- UIUtils.fixFocusTraversalKeys(privateNotesField);
-
- initSpellChecker();
- initDefaultButton();
-
- UIUtils.issue163946Hack(scrollPane1);
- font = UIManager.getFont("Label.font"); // NOI18N
- if (font != null) {
- mainScrollPane.getVerticalScrollBar().setUnitIncrement((int) (font.getSize() * 1.5));
- mainScrollPane.getHorizontalScrollBar().setUnitIncrement((int) (font.getSize() * 1.5));
- }
- }
-
- private void initDefaultButton() {
- if(Boolean.getBoolean("bugtracking.suppressActionKeys")) {
- return;
- }
- InputMap inputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
- inputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "submit"); // NOI18N
- ActionMap actionMap = getActionMap();
- Action submitAction = new AbstractAction() {
- @Override
- public void actionPerformed(ActionEvent e) {
- if (submitButton.isEnabled()) {
- submitButtonActionPerformed(null);
- }
- }
- };
- actionMap.put("submit", submitAction); // NOI18N
- }
-
- private void updateReadOnlyField(JTextField field) {
- if ("GTK".equals(UIManager.getLookAndFeel().getID())) { // NOI18N
- field.setUI(new BasicTextFieldUI());
- }
- Color bkColor = getBackground();
- if( null != bkColor )
- bkColor = new Color( bkColor.getRGB() );
- field.setBackground(bkColor);
- Caret caret = field.getCaret();
- if (caret instanceof DefaultCaret) {
- ((DefaultCaret)caret).setUpdatePolicy(DefaultCaret.NEVER_UPDATE);
- }
- }
-
- void reloadFormInAWT(final boolean force) {
- if (EventQueue.isDispatchThread()) {
- reloadForm(force);
- } else {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- reloadForm(force);
- }
- });
- }
- }
-
- PropertyChangeListener cacheListener = new PropertyChangeListener() {
- @Override
- public void propertyChange(PropertyChangeEvent evt) {
- if(evt.getSource() != IssuePanel.this.issue) {
- return;
- }
- if (IssueStatusProvider.EVENT_STATUS_CHANGED.equals(evt.getPropertyName())) {
- Mutex.EVENT.readAccess(new Runnable() {
- @Override
- public void run () {
- updateFieldStatuses();
- }
- });
- }
- }
- };
-
- BugzillaIssue getIssue() {
- return issue;
- }
-
- void modelStateChanged (final boolean isDirty, final boolean isModified) {
- Mutex.EVENT.readAccess(new Runnable() {
- @Override
- public void run () {
- if (!reloading && isDirty) {
- issue.markUserChange();
- }
- if (!isDirty) {
- clearUnsavedFields();
- }
- if (enableMap.isEmpty()) {
- cancelButton.setEnabled(isModified || isDirty);
- } else {
- enableMap.put(cancelButton, isModified || isDirty);
- }
- if (!initializingNewTask) {
- issue.fireChangeEvent();
- }
- }
- });
- }
-
- boolean initializingNewTask() {
- return initializingNewTask;
- }
-
- public void setIssue(BugzillaIssue issue) {
- assert SwingUtilities.isEventDispatchThread() : "Accessing Swing components. Do not call outside event-dispatch thread!"; // NOI18N
- if (this.issue == null) {
- issue.removePropertyChangeListener(cacheListener);
- issue.addPropertyChangeListener(cacheListener);
-
- summaryField.getDocument().addDocumentListener(new DocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
- @Override
- public void removeUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
- @Override
- public void changedUpdate(DocumentEvent e) {
- updateNoSummary();
- }
- });
- keywordsField.getDocument().addDocumentListener(new DocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
- @Override
- public void removeUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
- @Override
- public void changedUpdate(DocumentEvent e) {
- updateInvalidKeyword();
- }
- });
- }
- this.issue = issue;
- initCombos();
- List kws = issue.getRepository().getConfiguration().getKeywords();
- keywords.clear();
- for (String keyword : kws) {
- keywords.add(keyword.toUpperCase());
- }
- attachmentsSection.setActions(getAttachmentsSectionActions());
- setupListeners();
- boolean showQAContact = BugzillaUtil.showQAContact(issue.getRepository());
- if (qaContactLabel.isVisible() != showQAContact) {
- GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout();
- JLabel temp = new JLabel();
- swap(layout, ccLabel, qaContactLabel, temp);
- swap(layout, ccField, qaContactField, temp);
- qaContactLabel.setVisible(showQAContact);
- qaContactField.setVisible(showQAContact);
- }
- boolean showStatusWhiteboard = BugzillaUtil.showStatusWhiteboard(issue.getRepository());
- statusWhiteboardLabel.setVisible(showStatusWhiteboard);
- statusWhiteboardField.setVisible(showStatusWhiteboard);
- statusWhiteboardWarning.setVisible(showStatusWhiteboard);
- boolean showIssueType = BugzillaUtil.showIssueType(issue.getRepository());
- issueTypeLabel.setVisible(false);
- issueTypeCombo.setVisible(showIssueType);
- issueTypeWarning.setVisible(false);
- severityCombo.setVisible(!showIssueType);
- // Replace severity by issue-type
- if (showIssueType) {
- GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout();
- JLabel temp = new JLabel();
- swap(layout, severityCombo, issueTypeCombo, temp);
- }
-
- if (issue.isNew()) {
- if(NBBugzillaUtils.isNbRepository(issue.getRepository().getUrl())) {
- ownerInfo = issue.getOwnerInfo();
- if(ownerInfo == null) {
- // XXX not sure why we need this - i'm going to keep it for now,
- // doesn't seem to harm
- Node[] selection = WindowManager.getDefault().getRegistry().getActivatedNodes();
- ownerInfo = issue.getRepository().getOwnerInfo(selection);
- }
- }
- }
-
- // Hack to "link" the width of both columns
- Dimension dim = ccField.getPreferredSize();
- int width1 = Math.max(osCombo.getPreferredSize().width, platformCombo.getPreferredSize().width);
- int width2 = Math.max(priorityCombo.getPreferredSize().width, showIssueType ? issueTypeCombo.getPreferredSize().width : severityCombo.getPreferredSize().width);
- int gap = LayoutStyle.getInstance().getPreferredGap(osCombo, platformCombo, LayoutStyle.ComponentPlacement.RELATED, SwingConstants.EAST, this);
- ccField.setPreferredSize(new Dimension(2*Math.max(width1,width2)+gap,dim.height));
- }
-
- private void selectProduct() {
- if (ownerInfo != null) {
- String owner = findInModel(productCombo, ownerInfo.getOwner());
- productCombo.setSelectedItem(owner);
- List data = ownerInfo.getExtraData();
- if (data != null && data.size() > 0) {
- String component = findInModel(componentCombo, data.get(0));
- selectInCombo(componentCombo, component, true);
- }
- } else {
- BugzillaRepository repository = issue.getRepository();
- if (BugzillaUtil.isNbRepository(repository)) {
- // IssueProvider 181224
- String defaultProduct = "ide"; // NOI18N
- String defaultComponent = "Code"; // NOI18N
- productCombo.setSelectedItem(defaultProduct);
- componentCombo.setSelectedItem(defaultComponent);
- } else {
- productCombo.setSelectedIndex(0);
- }
- }
- storeFieldValueForNewIssue(IssueField.COMPONENT, componentCombo);
- }
-
- private String findInModel(JComboBox combo, String value) {
- ComboBoxModel model = combo.getModel();
- for(int i = 0; i < model.getSize(); i++) {
- String element = model.getElementAt(i).toString();
- if(value.equalsIgnoreCase(element)) {
- return element;
- }
- }
- return null;
- }
-
- private static void swap(GroupLayout layout, JComponent comp1, JComponent comp2, JComponent temp) {
- layout.replace(comp1, temp);
- layout.replace(comp2, comp1);
- layout.replace(temp, comp2);
- }
-
- private int oldCommentCount;
- void reloadForm(boolean force) {
- if (skipReload || !opened) {
- return;
- }
- enableComponents(true);
- reloading = true;
- clearHighlights();
-
- boolean isNew = issue.isNew();
- boolean showProductCombo = true;
- boolean hasTimeTracking = !isNew && issue.hasTimeTracking();
- GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout();
- if (showProductCombo) {
- if (productCombo.getParent() == null) {
- layout.replace(productField, productCombo);
- }
- } else {
- if (productField.getParent() == null) {
- layout.replace(productCombo, productField);
- }
- }
- productLabel.setLabelFor(isNew ? productCombo : productField);
- boolean isNetbeans = NBBugzillaUtils.isNbRepository(issue.getRepository().getUrl());
- if(isNew && isNetbeans) {
- attachLogCheckBox.setVisible(true);
- String attachLogValue = issue.getFieldValue(IssueField.NB_ATTACH_IDE_LOG);
- if (attachLogValue.isEmpty()) {
- attachLogCheckBox.setSelected(BugzillaConfig.getInstance().getAttachLogFile());
- } else {
- reloadField(attachLogCheckBox, IssueField.NB_ATTACH_IDE_LOG);
- }
- reproducibilityCombo.setVisible(true);
- reproducibilityLabel.setVisible(true);
- } else {
- reproducibilityCombo.setVisible(false);
- reproducibilityLabel.setVisible(false);
- attachLogCheckBox.setVisible(false);
- }
- switchViewLog();
- headerField.setVisible(!isNew);
- statusCombo.setEnabled(!isNew);
- newCommentSection.setLabel(NbBundle.getMessage(IssuePanel.class, isNew ? "IssuePanel.description" : "IssuePanel.newCommentSection.label")); // NOI18N
- reportedLabel.setVisible(!isNew);
- reportedField.setVisible(!isNew);
- modifiedLabel.setVisible(!isNew);
- modifiedField.setVisible(!isNew);
- assignToDefaultCheckBox.setVisible(!isNew && issue.canAssignToDefault());
- assignToDefaultCheckBox.setSelected(false);
- statusLabel.setVisible(!isNew);
- statusCombo.setVisible(!isNew);
- resolutionLabel.setVisible(!isNew);
- timetrackingLabel.setVisible(hasTimeTracking);
- timetrackingPanel.setVisible(hasTimeTracking);
- dummyTimetrackingLabel.setVisible(hasTimeTracking);
- commentsSection.setVisible(!isNew);
- attachmentsSection.setVisible(!isNew);
- dummyLabel3.setVisible(!isNew);
- refreshButton.setVisible(!isNew);
- cancelButton.setVisible(!isNew);
- separatorLabel6.setVisible(!isNew);
- btnDeleteTask.setVisible(isNew);
- separatorDismissButton.setVisible(isNew);
- separatorLabel3.setVisible(!isNew);
- showInBrowserButton.setVisible(!isNew);
- separatorLabel4.setVisible(!isNew);
- privateSection.setVisible(!isNew);
- assignedField.setEditable(issue.isNew() || issue.canReassign());
- assignedCombo.setEnabled(assignedField.isEditable());
- org.openide.awt.Mnemonics.setLocalizedText(submitButton, NbBundle.getMessage(IssuePanel.class, isNew ? "IssuePanel.submitButton.text.new" : "IssuePanel.submitButton.text")); // NOI18N
- if (isNew && force && issue.isMarkedNewUnread()) {
- // this should not be called when reopening task to submit
- initializeNewTask();
- initStatusCombo("NEW"); // NOI18N
- } else {
- String format = NbBundle.getMessage(IssuePanel.class, "IssuePanel.headerLabel.format"); // NOI18N
- String headerTxt = MessageFormat.format(format, issue.getID(), issue.getSummary());
- headerField.setText(headerTxt);
- Dimension dim = headerField.getPreferredSize();
- headerField.setMinimumSize(new Dimension(0, dim.height));
- headerField.setPreferredSize(new Dimension(0, dim.height));
- reloadField(force, summaryField, IssueField.SUMMARY);
- reloadField(force, productCombo, IssueField.PRODUCT);
- productChanged(false);
- reloadField(productField, IssueField.PRODUCT);
- reloadField(force, componentCombo, IssueField.COMPONENT);
- reloadField(force, versionCombo, IssueField.VERSION);
- reloadField(force, platformCombo, IssueField.PLATFORM);
- reloadField(force, osCombo, IssueField.OS);
- reloadField(resolutionField, IssueField.RESOLUTION); // Must be before statusCombo
- initStatusCombo(issue.getRepositoryFieldValue(IssueField.STATUS));
- reloadField(force, statusCombo, IssueField.STATUS);
- reloadField(force, resolutionCombo, IssueField.RESOLUTION);
-
- reloadField(force, duplicateField, IssueField.DUPLICATE_ID);
- JTextField field = new JTextField();
- duplicateField.setBorder(field.getBorder());
- duplicateField.setBackground(field.getBackground());
-
- reloadField(force, priorityCombo, IssueField.PRIORITY);
- if (BugzillaUtil.isNbRepository(issue.getRepository())) {
- reloadField(force, issueTypeCombo, IssueField.ISSUE_TYPE);
- }
- reloadField(force, severityCombo, IssueField.SEVERITY);
- if (usingTargetMilestones) {
- reloadField(force, targetMilestoneCombo, IssueField.MILESTONE);
- }
- reloadField(assignToDefaultCheckBox, IssueField.REASSIGN_TO_DEFAULT);
- reloadField(urlField, IssueField.URL);
- reloadField(force, statusWhiteboardField, IssueField.WHITEBOARD);
- reloadField(force, keywordsField, IssueField.KEYWORDS);
- if (isNew) {
- if (addCommentArea.getText().isEmpty()) {
- reloadField(addCommentArea, IssueField.DESCRIPTION);
- }
- } else {
- reloadField(addCommentArea, IssueField.COMMENT);
- }
-
- if (!isNew) {
- // reported field
- format = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reportedLabel.format"); // NOI18N
- Date creation = issue.getCreatedDate();
- String creationTxt = creation != null ? DateFormat.getDateInstance(DateFormat.DEFAULT).format(creation) : ""; // NOI18N
- String reporterName = issue.getFieldValue(IssueField.REPORTER_NAME);
- String reporter = issue.getFieldValue(IssueField.REPORTER);
- String reporterTxt = ((reporterName == null) || (reporterName.trim().length() == 0)) ? reporter : reporterName;
- String reportedTxt = MessageFormat.format(format, creationTxt, reporterTxt);
- reportedField.setText(reportedTxt);
- fixPrefSize(reportedField);
-
- // modified field
- Date modification = issue.getLastModifyDate();
- String modifiedTxt = modification != null ? DateFormat.getDateTimeInstance().format(modification) : ""; // NOI18N
- modifiedField.setText(modifiedTxt);
- fixPrefSize(modifiedField);
-
- String privateNotes = issue.getPrivateNotes();
- privateNotesField.setText(privateNotes);
- setPrivateSectionLabel(privateNotes);
-
- dueDatePicker.setDate(issue.getDueDate());
- NbDateRange scheduleDate = issue.getScheduleDate();
- scheduleDatePicker.setScheduleDate(scheduleDate == null ? null : scheduleDate.toSchedulingInfo());
- estimateField.setValue(issue.getEstimate());
- dueDatePicker.getComponent().setEnabled(!hasTimeTracking);
-
- // time tracking
- if(hasTimeTracking) {
- reloadField(force, estimatedField, IssueField.ESTIMATED_TIME);
- reloadField(force, workedField, IssueField.WORK_TIME);
- reloadField(force, remainingField, IssueField.REMAINING_TIME);
- reloadField(force, deadlinePicker, IssueField.DEADLINE);
-
- String actualString = issue.getFieldValue(IssueField.ACTUAL_TIME);
- if(actualString.trim().equals("")) { // NOI18N
- actualString = "0"; // NOI18N
- }
- actualField.setText(String.valueOf(Double.parseDouble(actualString) + getDoubleValue(remainingField)));
- double worked = 0;
- Comment[] comments = issue.getComments();
- for (Comment comment : comments) {
- worked += comment.getWorked();
- }
- workedSumField.setText(String.valueOf(worked));
- gainField.setText(String.valueOf(getDoubleValue(estimatedField) - getDoubleValue(remainingField)));
- completeField.setText(String.valueOf((int)Math.floor(getDoubleValue(workedSumField) / getDoubleValue(actualField) * 100)));
- }
- }
-
- String assignee = issue.getFieldValue(IssueField.ASSIGNED_TO);
- String selectedAssignee = (assignedField.getParent() == null) ? assignedCombo.getSelectedItem().toString() : assignedField.getText();
- if (force) {
- assignedToStatusLabel.setVisible(assignee.trim().length() > 0);
- }
- if (assignedField.getParent() == null) {
- reloadField(force, assignedCombo, IssueField.ASSIGNED_TO);
- } else {
- reloadField(force, assignedField, IssueField.ASSIGNED_TO);
- }
- reloadField(force, qaContactField, IssueField.QA_CONTACT);
- reloadField(force, ccField, IssueField.CC);
- reloadField(force, dependsField, IssueField.DEPENDS_ON);
- reloadField(force, blocksField, IssueField.BLOCKS);
- if (!customFieldsLoaded) {
- customFieldsLoaded = true;
- initCustomFields();
- }
- reloadCustomFields(force);
- }
- int newCommentCount = issue.getComments().length;
- if (!force) {
- if (oldCommentCount != newCommentCount) {
- String message = NbBundle.getMessage(IssuePanel.class, "IssuePanel.commentAddedWarning"); // NOI18N
- fieldsIncoming.put(IssueField.COMMENT_COUNT, message);
- } else {
- fieldsIncoming.remove(IssueField.COMMENT_COUNT);
- }
- }
- oldCommentCount = newCommentCount;
- List attachments = issue.getAttachments();
- List unsubmitted = issue.getUnsubmittedAttachments();
- if (!isNew) {
- commentsPanel.setIssue(issue, attachments);
- commentsSection.setLabel(NbBundle.getMessage(IssuePanel.class, "IssuePanel.commentsLabel.text", issue.getComments().length + 1)); //NOI18N
- }
- if(isNetbeans) {
- AttachmentsPanel.NBBugzillaCallback callback =
- new AttachmentsPanel.NBBugzillaCallback() {
- @Override
- public String getLogFilePath() {
- return NbBugzillaConstants.NB_LOG_FILE_PATH;
- }
- @Override
- public String getLogFileContentType() {
- return NbBugzillaConstants.NB_LOG_FILE_ATT_CONT_TYPE;
- }
- @Override
- public String getLogFileDescription() {
- return Bundle.MSG_LOG_FILE_DESC();
- }
- @Override
- public void showLogFile() {
- IssuePanel.showLogFile(null);
- }
- };
- attachmentsPanel.setAttachments(attachments, unsubmitted, callback);
- } else {
- attachmentsPanel.setAttachments(attachments, unsubmitted, null);
- }
- attachmentsSection.setLabel(NbBundle.getMessage(IssuePanel.class, "IssuePanel.attachmentsLabel.text", attachments.size())); //NOI18N
- UIUtils.keepFocusedComponentVisible(commentsPanel, this);
- UIUtils.keepFocusedComponentVisible(attachmentsPanel, this);
- updateFieldStatuses();
- updateNoSummary();
- updateMessagePanel();
- cancelButton.setEnabled(issue.hasLocalEdits() || !unsavedFields.isEmpty());
- reloading = false;
- repaint();
- }
-
- protected void setPrivateSectionLabel(String privateNotes) throws MissingResourceException {
- if(privateNotes != null && !privateNotes.isEmpty() ) {
- privateSection.setLabel("" + // NOI18N
- org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.text") + // NOI18N
- " (" + // NOI18N
- org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.containsNotes") + // NOI18N
- " )"); // NOI18N
- } else {
- privateSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.text")); // NOI18N
- }
- }
-
- private void reloadCustomFields(boolean force) {
- // Reload custom fields
- for (CustomFieldInfo field : customFields) {
- reloadField(force, field.comp, field.field);
- }
- }
-
- private static void fixPrefSize(JTextField textField) {
- // The preferred size of JTextField on (Classic) Windows look and feel
- // is one pixel shorter. The following code is a workaround.
- textField.setPreferredSize(null);
- Dimension dim = textField.getPreferredSize();
- Dimension fixedDim = new Dimension(dim.width+1, dim.height);
- textField.setPreferredSize(fixedDim);
- }
-
- private void reloadField (boolean force, Object component, IssueField field) {
- reloadField(component, field);
- }
-
- private void reloadField (Object component, IssueField field) {
- String newValue;
- if (component instanceof JList) {
- newValue = mergeValues(issue.getFieldValues(field));
- } else {
- newValue = issue.getFieldValue(field);
- }
- boolean fieldDirty = unsavedFields.contains(field.getKey());
- if (!fieldDirty) {
- if (component instanceof JComboBox) {
- JComboBox combo = (JComboBox)component;
- selectInCombo(combo, newValue, true);
- } else if (component instanceof JTextComponent) {
- ((JTextComponent)component).setText(newValue);
- } else if (component instanceof JList) {
- JList list = (JList)component;
- list.clearSelection();
- ListModel model = list.getModel();
- for (String value : issue.getFieldValues(field)) {
- for (int i=0; i... fields) {
- updateFieldDecorations(warningLabel, fieldLabel, fieldName(fieldLabel), fields);
- }
-
- @NbBundle.Messages({
- "# {0} - field name", "# {1} - old value", "# {2} - new value",
- "IssuePanel.fieldModifiedRemotely={0} field was changed in repository from \"{1}\" to \"{2}\"",
- "# {0} - field name", "# {1} - old value", "# {2} - new value", "# {3} - icon path",
- "IssuePanel.fieldModifiedRemotelyTT= Remote change - {0}
"
- + ""
- + "remote value: {2} "
- + "base value: {1} "
- + "
"
- + "Field {0} was changed in repository from \"{1} \" to \"{2} \".
"
- + "
",
- "# {0} - field name", "# {1} - old value", "# {2} - new value",
- "IssuePanel.fieldModifiedConflict={0} field was changed in repository from \"{1}\" to \"{2}\" "
- + "before you submitted your local changes. "
- + "Local value will be submitted.",
- "# {0} - field name", "# {1} - old value", "# {2} - incoming value", "# {3} - local value", "# {4} - icon path",
- "IssuePanel.fieldModifiedConflictTT= Conflict - {0}
"
- + ""
- + "incoming value: {2} "
- + "local value: {3} "
- + "base value: {1} "
- + "
"
- + "Field {0} was changed in repository from \"{1} \" to \"{2} \" "
- + "before you submitted your local changes."
- + "Local value will be submitted.
"
- + "
",
- "# {0} - field name", "# {1} - old value", "# {2} - new value",
- "IssuePanel.fieldModifiedLocally={0} field was changed locally from \"{1}\" to \"{2}\" but not yet submitted.",
- "# {0} - field name", "# {1} - old value", "# {2} - new value", "# {3} - icon path",
- "IssuePanel.fieldModifiedLocallyTT= Unsubmitted change - {0}
"
- + ""
- + "local value: {2} "
- + "base value: {1} "
- + "
"
- + "Field {0} was changed locally from \"{1} \" to \"{2} \" but not yet submitted.
"
- + "
",
- "IssuePanel.commentAddedLocally=Comment was added but not yet submitted.",
- "# {0} - icon path",
- "IssuePanel.commentAddedLocallyTT= Unsubmitted change - New Comment
"
- + "A new comment was added but not yet submitted.
"
- })
- private void updateFieldDecorations (JLabel warningLabel, JComponent fieldLabel, String fieldName,
- Pair... fields) {
- boolean isNew = issue.isNew();
- String newValue = "", lastSeenValue = "", repositoryValue = ""; //NOI18N
- boolean fieldDirty = false;
- boolean valueModifiedByUser = false;
- boolean valueModifiedByServer = false;
- for (Pair p : fields) {
- Object component = p.second();
- IssueField field = p.first();
- if (component instanceof JList) {
- newValue += " " + mergeValues(issue.getFieldValues(field));
- lastSeenValue += " " + mergeValues(issue.getLastSeenFieldValues(field));
- repositoryValue += " " + mergeValues(issue.getRepositoryFieldValues(field));
- } else {
- newValue += " " + issue.getFieldValue(field);
- lastSeenValue += " " + issue.getLastSeenFieldValue(field);
- repositoryValue += " " + issue.getRepositoryFieldValue(field);
- }
- fieldDirty |= unsavedFields.contains(field.getKey());
- valueModifiedByUser |= (issue.getFieldStatus(field) & BugzillaIssue.FIELD_STATUS_OUTGOING) != 0;
- valueModifiedByServer |= (issue.getFieldStatus(field) & BugzillaIssue.FIELD_STATUS_MODIFIED) != 0;
- }
- newValue = newValue.substring(1);
- lastSeenValue = lastSeenValue.substring(1);
- repositoryValue = repositoryValue.substring(1);
- if (warningLabel != null) {
- boolean change = false;
- if (!isNew) {
- boolean visible = warningLabel.isVisible();
- IssueField field = fields[0].first();
- removeTooltips(warningLabel, field);
- if (fieldLabel != null && fieldLabel.getFont().isBold()) {
- fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() & ~Font.BOLD));
- }
- if (visible && valueModifiedByServer && (valueModifiedByUser || fieldDirty) && !newValue.equals(repositoryValue)) {
- String message = Bundle.IssuePanel_fieldModifiedConflict(fieldName, lastSeenValue, repositoryValue);
- // do not use ||
- change = fieldsLocal.remove(field) != null | fieldsIncoming.remove(field) != null
- | !message.equals(fieldsConflict.put(field, message));
- tooltipsConflict.addTooltip(warningLabel, field, Bundle.IssuePanel_fieldModifiedConflictTT(
- fieldName, lastSeenValue, repositoryValue, newValue, ICON_CONFLICT_PATH));
- } else if (visible && valueModifiedByServer) {
- String message = Bundle.IssuePanel_fieldModifiedRemotely(fieldName, lastSeenValue, repositoryValue);
- // do not use ||
- change = fieldsLocal.remove(field) != null | fieldsConflict.remove(field) != null
- | !message.equals(fieldsIncoming.put(field, message));
- tooltipsIncoming.addTooltip(warningLabel, field, Bundle.IssuePanel_fieldModifiedRemotelyTT(
- fieldName, lastSeenValue, repositoryValue, ICON_REMOTE_PATH));
- } else if (visible && (valueModifiedByUser || fieldDirty) && !newValue.equals(lastSeenValue)) {
- String message;
- if (field == IssueField.COMMENT) {
- message = Bundle.IssuePanel_commentAddedLocally();
- tooltipsLocal.addTooltip(warningLabel, field, Bundle.IssuePanel_commentAddedLocallyTT(ICON_UNSUBMITTED_PATH));
- } else {
- message = Bundle.IssuePanel_fieldModifiedLocally(fieldName, lastSeenValue, newValue);
- tooltipsLocal.addTooltip(warningLabel, field, Bundle.IssuePanel_fieldModifiedLocallyTT(
- fieldName, lastSeenValue, newValue, ICON_UNSUBMITTED_PATH));
- }
- // do not use ||
- change = fieldsConflict.remove(field) != null | fieldsIncoming.remove(field) != null
- | !message.equals(fieldsLocal.put(field, message));
- } else {
- // do not use ||
- change = fieldsLocal.remove(field) != null
- | fieldsConflict.remove(field) != null
- | fieldsIncoming.remove(field) != null;
- }
- updateIcon(warningLabel);
- if (fieldDirty && fieldLabel != null) {
- fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() | Font.BOLD));
- }
- }
- if (change && !reloading) {
- updateMessagePanel();
- }
- }
- }
-
- @NbBundle.Messages({
- "# {0} - icon path",
- "IssuePanel.attachmentsToSubmit= Unsubmitted Attachments
"
- + "New attachments were added but not yet submitted
",
- "IssuePanel.attachmentsAddedLocally=Attachments were added but not yet submitted"
- })
- private void updateAttachmentsStatus () {
- boolean change = false;
- if (!issue.isNew()) {
- boolean valueModifiedByUser = !issue.getUnsubmittedAttachments().isEmpty();
- removeTooltips(attachmentsWarning, IssueField.NB_NEW_ATTACHMENTS);
- AbstractButton attachmentsLabel = attachmentsSection.getLabelComponent();
- if (attachmentsLabel.getFont().isBold()) {
- attachmentsLabel.setFont(attachmentsLabel.getFont().deriveFont(attachmentsLabel.getFont().getStyle() & ~Font.BOLD));
- }
- if (valueModifiedByUser) {
- String message = Bundle.IssuePanel_attachmentsAddedLocally();
- tooltipsLocal.addTooltip(attachmentsWarning, IssueField.NB_NEW_ATTACHMENTS,
- Bundle.IssuePanel_attachmentsToSubmit(ICON_UNSUBMITTED_PATH));
- change = !message.equals(fieldsLocal.put(IssueField.NB_NEW_ATTACHMENTS, message));
- } else {
- change = fieldsLocal.remove(IssueField.NB_NEW_ATTACHMENTS) != null;
- }
- updateIcon(attachmentsWarning);
- if (unsavedFields.contains(IssueField.NB_NEW_ATTACHMENTS.getKey())) {
- attachmentsLabel.setFont(attachmentsLabel.getFont().deriveFont(attachmentsLabel.getFont().getStyle() | Font.BOLD));
- }
- }
- if (change && !reloading) {
- updateMessagePanel();
- }
- }
-
- private void updateFieldDecorations (String key, JComponent fieldLabel) {
- boolean fieldDirty = unsavedFields.contains(key);
- if (fieldLabel != null) {
- if (fieldDirty) {
- fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() | Font.BOLD));
- } else {
- fieldLabel.setFont(fieldLabel.getFont().deriveFont(fieldLabel.getFont().getStyle() & ~Font.BOLD));
- }
- }
- }
-
- private boolean selectInCombo(JComboBox combo, Object value, boolean forceInModel) {
- if (value == null) {
- return false;
- }
- if (!value.equals(combo.getSelectedItem())) {
- combo.setSelectedItem(value);
- }
- if (forceInModel && !value.equals("") && !value.equals(combo.getSelectedItem())) { // NOI18N
- // Reload of server attributes is needed - workarounding it
- ComboBoxModel model = combo.getModel();
- if (model instanceof DefaultComboBoxModel) {
- ((DefaultComboBoxModel)model).insertElementAt(value, 0);
- combo.setSelectedIndex(0);
- }
- }
- return value.equals(combo.getSelectedItem());
- }
-
- private String fieldName(JComponent fieldLabel) {
- assert fieldLabel instanceof JLabel || fieldLabel instanceof AbstractButton;
- String txt;
- if(fieldLabel instanceof JLabel) {
- txt = ((JLabel) fieldLabel).getText().trim();
-
- } else if(fieldLabel instanceof AbstractButton) {
- txt = ((AbstractButton) fieldLabel).getText().trim();
- } else {
- return null;
- }
- if (txt.endsWith(":")) { // NOI18N
- txt = txt.substring(0, txt.length()-1);
- }
- return txt;
- }
-
- @NbBundle.Messages({
- "LBL_HappensAlways=Happens every time",
- "LBL_HappensSometimes=Happens sometimes, but not always",
- "LBL_HaventTried=Haven't tried to reproduce it",
- "LBL_Tried=Tried, but couldn't reproduce it"
- })
- private void initCombos() {
- BugzillaRepository repository = issue.getRepository();
- BugzillaConfiguration bc = repository.getConfiguration();
- if(bc == null || !bc.isValid()) {
- // XXX nice error msg?
- return;
- }
- productCombo.setModel(toComboModel(bc.getProducts()));
- // componentCombo, versionCombo, targetMilestoneCombo are filled
- // automatically when productCombo is set/changed
- platformCombo.setModel(toComboModel(bc.getPlatforms()));
- osCombo.setModel(toComboModel(bc.getOSs()));
- // Do not support MOVED resolution (yet?)
- List resolutions = new LinkedList<>(bc.getResolutions());
- resolutions.remove("MOVED"); // NOI18N
- resolutionCombo.setModel(toComboModel(resolutions));
- priorityCombo.setModel(toComboModel(bc.getPriorities()));
- priorityCombo.setRenderer(new PriorityRenderer());
- severityCombo.setModel(toComboModel(bc.getSeverities()));
-
- initAssignedCombo();
-
- if (BugzillaUtil.isNbRepository(repository)) {
- issueTypeCombo.setModel(toComboModel(bc.getIssueTypes()));
- reproducibilityCombo.setModel(toComboModel(Arrays.asList(Bundle.LBL_HappensAlways(), Bundle.LBL_HappensSometimes(), Bundle.LBL_HaventTried(), Bundle.LBL_Tried())));
- reproducibilityCombo.setSelectedItem(null);
- }
- // stausCombo and resolution fields are filled in reloadForm
- }
-
- private void initAssignedCombo() {
- assignedCombo.setRenderer(new RepositoryUserRenderer());
- RP.post(new Runnable() {
- @Override
- public void run() {
- BugzillaRepository repository = issue.getRepository();
- final Collection users = repository.getUsers();
- final DefaultComboBoxModel assignedModel = new DefaultComboBoxModel();
- for (RepositoryUser user: users) {
- assignedModel.addElement(user);
- }
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- reloading = true;
- try {
- Object assignee = (assignedField.getParent() == null) ? assignedCombo.getSelectedItem() : assignedField.getText();
- if (assignee == null) {
- assignee = ""; //NOI18N
- }
- assignedCombo.setModel(assignedModel);
- GroupLayout layout = (GroupLayout) attributesSectionPanel.getLayout();
- if ((assignedCombo.getParent()==null) != users.isEmpty()) {
- layout.replace(users.isEmpty() ? assignedCombo : assignedField, users.isEmpty() ? assignedField : assignedCombo);
- assignedLabel.setLabelFor(users.isEmpty() ? assignedField : assignedCombo);
- }
- if (assignedField.getParent() == null) {
- assignedCombo.setSelectedItem(assignee);
- } else {
- assignedField.setText(assignee.toString());
- }
- } finally {
- reloading = false;
- }
- }
- });
- }
- });
- }
-
- private void initStatusCombo(String currentStatus) {
- // Init statusCombo - allowed transitions (heuristics):
- // Open -> Open-Unconfirmed-Reopened+Resolved
- // Resolved -> Reopened+Close
- // Close-Resolved -> Reopened+Resolved+(Close with higher index)
- BugzillaRepository repository = issue.getRepository();
- BugzillaConfiguration bc = repository.getConfiguration();
- if(bc == null || !bc.isValid()) {
- // XXX nice error msg?
- return;
- }
- List allStatuses = bc.getStatusValues();
- List openStatuses = bc.getOpenStatusValues();
- List statuses = new LinkedList<>();
- boolean oldRepository = (issue.getRepository().getConfiguration().getInstalledVersion().compareMajorMinorOnly(BugzillaVersion.BUGZILLA_3_2) < 0);
- String nev = "NEW"; // NOI18N
- String unconfirmed = "UNCONFIRMED"; // NOI18N
- String reopened = "REOPENED"; // NOI18N
- String resolved = "RESOLVED"; // NOI18N
- if (currentStatus != null) {
- currentStatus = currentStatus.trim();
- }
- String status = issue.getLastSeenFieldValue(IssueField.STATUS);
- if (status.isEmpty()) {
- status = currentStatus;
- }
- if (openStatuses.contains(status)) {
- statuses.addAll(openStatuses);
- if (!unconfirmed.equals(status)) {
- statuses.remove(unconfirmed);
- }
- if (!reopened.equals(status)) {
- statuses.remove(reopened);
- }
- if (oldRepository && !nev.equals(status)) {
- statuses.remove(nev);
- }
- statuses.add(resolved);
- } else {
- if (allStatuses.contains(reopened)) {
- statuses.add(reopened);
- } else {
- // Pure guess
- statuses.addAll(openStatuses);
- statuses.remove(unconfirmed);
- if (oldRepository) {
- statuses.remove(nev);
- }
- }
- if (resolved.equals(status)) {
- List closedStatuses = new LinkedList<>(allStatuses);
- closedStatuses.removeAll(openStatuses);
- statuses.addAll(closedStatuses);
- } else {
- if (!oldRepository) {
- statuses.add(resolved);
- }
- if (allStatuses.contains(status)) {
- if (!"".equals(status)) {
- for (int i = allStatuses.indexOf(status); i < allStatuses.size(); i++) {
- String s = allStatuses.get(i);
- if (!openStatuses.contains(s)) {
- statuses.add(s);
- }
- }
- }
- } else {
- Bugzilla.LOG.log(Level.WARNING, "status value {0} not between all statuses: {1}", new Object[]{status, allStatuses}); // NOI18N
- }
- }
- }
- resolvedIndex = statuses.indexOf(resolved);
- statusCombo.setModel(toComboModel(statuses));
- statusCombo.setSelectedItem(currentStatus);
- }
-
- private ComboBoxModel toComboModel(List items) {
- return new DefaultComboBoxModel(items.toArray());
- }
-
- private void updateFieldStatuses() {
- updateFieldStatus(summaryLabel, IssueField.SUMMARY);
- updateFieldDecorations(summaryField, IssueField.SUMMARY, summaryWarning, summaryLabel);
- updateFieldStatus(productLabel, IssueField.PRODUCT);
- updateFieldDecorations(productCombo.getParent() == null ? productField : productCombo,
- IssueField.PRODUCT, productWarning, productLabel);
- updateFieldStatus(componentLabel, IssueField.COMPONENT);
- updateFieldDecorations(componentCombo, IssueField.COMPONENT, componentWarning, componentLabel);
- updateFieldStatus(versionLabel, IssueField.VERSION);
- updateFieldDecorations(versionCombo, IssueField.VERSION, versionWarning, versionLabel);
- updateFieldStatus(platformLabel, IssueField.PLATFORM, IssueField.OS);
- updateFieldDecorations(platformWarning, platformLabel, new Pair[] {
- Pair.of(IssueField.PLATFORM, platformCombo),
- Pair.of(IssueField.OS, osCombo)
- });
- updateFieldStatus(statusLabel, IssueField.STATUS);
- updateFieldDecorations(statusCombo, IssueField.STATUS, statusWarning, statusLabel);
- updateFieldStatus(resolutionLabel, IssueField.RESOLUTION);
- updateFieldDecorations(resolutionCombo, IssueField.RESOLUTION, resolutionWarning, resolutionLabel);
- updateFieldStatus(duplicateLabel, IssueField.DUPLICATE_ID);
- updateFieldDecorations(duplicateWarning, duplicateLabel, Bundle.LBL_Duplicate_fieldName(), Pair.of(IssueField.DUPLICATE_ID, duplicateField));
- if (BugzillaUtil.showIssueType(issue.getRepository())) {
- updateFieldStatus(priorityLabel, IssueField.PRIORITY, IssueField.ISSUE_TYPE);
- updateFieldDecorations(priorityWarning, priorityLabel, new Pair[] {
- Pair.of(IssueField.PRIORITY, priorityCombo),
- Pair.of(IssueField.ISSUE_TYPE, issueTypeCombo)
- });
- } else {
- updateFieldStatus(priorityLabel, IssueField.PRIORITY, IssueField.SEVERITY);
- updateFieldDecorations(priorityWarning, priorityLabel, new Pair[] {
- Pair.of(IssueField.PRIORITY, priorityCombo),
- Pair.of(IssueField.SEVERITY, severityCombo)
- });
- }
- updateFieldStatus(targetMilestoneLabel, IssueField.MILESTONE);
- updateFieldDecorations(targetMilestoneCombo, IssueField.MILESTONE, milestoneWarning, targetMilestoneLabel);
- updateFieldStatus(urlLabel, IssueField.URL);
- updateFieldDecorations(urlField, IssueField.URL, urlWarning, urlLabel);
- updateFieldStatus(statusWhiteboardLabel, IssueField.WHITEBOARD);
- updateFieldDecorations(statusWhiteboardField, IssueField.WHITEBOARD, statusWhiteboardWarning, statusWhiteboardLabel);
- updateFieldStatus(keywordsLabel, IssueField.KEYWORDS);
- updateFieldDecorations(keywordsField, IssueField.KEYWORDS, keywordsWarning, keywordsLabel);
- updateFieldStatus(assignedLabel, IssueField.ASSIGNED_TO);
- if (assignedField.getParent() == null) {
- updateFieldDecorations(assignedCombo, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel);
- } else {
- updateFieldDecorations(assignedField, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel);
- }
- updateFieldStatus(qaContactLabel, IssueField.QA_CONTACT);
- updateFieldDecorations(qaContactField, IssueField.QA_CONTACT, qaContactWarning, qaContactLabel);
- updateFieldStatus(ccLabel, IssueField.CC);
- updateFieldDecorations(ccField, IssueField.CC, ccWarning, ccLabel);
- updateFieldStatus(dependsLabel, IssueField.DEPENDS_ON);
- updateFieldDecorations(dependsField, IssueField.DEPENDS_ON, dependsOnWarning, dependsLabel);
- updateFieldStatus(blocksLabel, IssueField.BLOCKS);
- updateFieldDecorations(blocksField, IssueField.BLOCKS, blocksWarning, blocksLabel);
- updateFieldStatus(timetrackingWarning, IssueField.ESTIMATED_TIME,
- IssueField.REMAINING_TIME,
- IssueField.WORK_TIME,
- IssueField.DEADLINE,
- IssueField.COMMENT);
- updateFieldDecorations(estimatedField, IssueField.ESTIMATED_TIME, timetrackingWarning, estimatedLabel);
- updateFieldDecorations(remainingField, IssueField.REMAINING_TIME, timetrackingWarning, remainingLabel);
- updateFieldDecorations(workedField, IssueField.WORK_TIME, timetrackingWarning, workedLabel);
- updateFieldDecorations(deadlinePicker, IssueField.DEADLINE, timetrackingWarning, deadlineLabel);
- updateFieldStatus(newCommentSection.getLabelComponent());
- updateFieldDecorations(addCommentArea, IssueField.COMMENT, commentWarning, newCommentSection.getLabelComponent());
- updateCustomFieldStatuses();
- updateAttachmentsStatus();
-
- updateFieldDecorations(ATTRIBUTE_PRIVATE_NOTES, notesLabel);
- updateFieldDecorations(ATTRIBUTE_DUE_DATE, dueDateLabel);
- updateFieldDecorations(ATTRIBUTE_SCHEDULE_DATE, scheduleDateLabel);
- updateFieldDecorations(ATTRIBUTE_ESTIMATE, estimateLabel);
-
- repaint();
- }
-
- private void updateCustomFieldStatuses () {
- for (CustomFieldInfo field : customFields) {
- updateFieldStatus(field.label, field.field);
- updateFieldDecorations(field.comp, field.field, field.warning, field.label);
- }
- }
-
- private void updateFieldStatus(JComponent label, IssueField... fields) {
- label.setOpaque(false);
- for (IssueField field : fields) {
- boolean highlight = !issue.isNew() && (issue.getFieldStatus(field) & BugzillaIssue.FIELD_STATUS_MODIFIED) != 0;
- if (highlight) {
- label.setOpaque(true);
- label.setBackground(incomingChangesColor);
- break;
- }
- }
- }
-
- private void cancelHighlight(JComponent label) {
- if (!reloading) {
- label.setOpaque(false);
- label.getParent().repaint();
- }
- }
-
- private void storeFieldValue(IssueField field, JComboBox combo) {
- Object value = combo.getSelectedItem();
- // It (normally) should not happen that value is null, but issue 159804 shows that
- // some strange configurations (or other bugs) can lead into this situation
- if (value != null) {
- storeFieldValue(field, value.toString());
- }
- }
-
- private void storeFieldValue(IssueField field, JTextComponent textComponent) {
- storeFieldValue(field, textComponent.getText());
- }
-
- private void storeFieldValue(IssueField field, JList list) {
- List values = new ArrayList<>();
- for (Object value : list.getSelectedValues()) {
- values.add(value.toString());
- }
- if (!issue.getFieldValues(field).equals(values)) {
- addUnsavedField(field.getKey());
- issue.setFieldValues(field, values);
- }
- }
-
- private void storeFieldValue(IssueField field, String value) {
- boolean changed = false;
- if (field == IssueField.STATUS) {
- changed = true;
- if (value.equals("CLOSED")) { // NOI18N
- issue.close();
- issue.setFieldValue(IssueField.RESOLUTION, resolutionField.getText());
- } else if (value.equals("VERIFIED")) { // NOI18N
- issue.verify();
- issue.setFieldValue(IssueField.RESOLUTION, resolutionField.getText());
- } else if (value.equals("REOPENED")) { // NOI18N
- issue.reopen();
- issue.setFieldValue(IssueField.RESOLUTION, ""); //NOI18N
- } else if (value.equals("RESOLVED")) { // NOI18N
- issue.resolve(resolutionCombo.getSelectedItem().toString());
- addUnsavedField(IssueField.RESOLUTION.getKey());
- issue.setFieldValue(IssueField.RESOLUTION, resolutionCombo.getSelectedItem().toString());
- } else if (value.equals("ASSIGNED")) { // NOI18N
- issue.accept();
- issue.setFieldValue(IssueField.RESOLUTION, ""); //NOI18N
- } else {
- issue.setFieldValue(IssueField.RESOLUTION, ""); //NOI18N
- changed = false;
- }
- } else if (field == IssueField.RESOLUTION && "RESOLVED".equals(statusCombo.getSelectedItem())) {
- changed = true;
- if (value.equals("DUPLICATE")) {
- issue.duplicate(duplicateField.getText().trim());
- if (!duplicateField.getText().trim().equals(issue.getFieldValue(IssueField.DUPLICATE_ID))) {
- addUnsavedField(IssueField.DUPLICATE_ID.getKey());
- issue.setFieldValue(IssueField.DUPLICATE_ID, duplicateField.getText().trim());
- }
- } else {
- issue.resolve(value);
- }
- } else if (field == IssueField.DUPLICATE_ID && "RESOLVED".equals(statusCombo.getSelectedItem())
- && "DUPLICATE".equals(resolutionCombo.getSelectedItem())) {
- issue.duplicate(value);
- addUnsavedField(field.getKey());
- } else if ((field == IssueField.ASSIGNED_TO) && !issue.isNew()) {
- issue.reassign(value);
- addUnsavedField(field.getKey());
- }
- if (changed || !issue.getFieldValue(field).equals(value)) {
- addUnsavedField(field.getKey());
- issue.setFieldValue(field, value);
- }
- }
-
- private void attachDocumentListeners() {
- urlField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(urlLabel));
- statusWhiteboardField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(statusWhiteboardLabel));
- keywordsField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(keywordsLabel));
- assignedField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(assignedLabel));
- qaContactField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(qaContactLabel));
- ccField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(ccLabel));
- blocksField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(blocksLabel));
- dependsField.getDocument().addDocumentListener(new CancelHighlightDocumentListener(dependsLabel));
- CyclicDependencyDocumentListener cyclicDependencyListener = new CyclicDependencyDocumentListener();
- blocksField.getDocument().addDocumentListener(cyclicDependencyListener);
- dependsField.getDocument().addDocumentListener(cyclicDependencyListener);
- addCommentArea.getDocument().addDocumentListener(new RevalidatingListener());
- duplicateField.getDocument().addDocumentListener(new DuplicateListener());
- }
-
- private void attachHideStatusListener() {
- assignedField.getDocument().addDocumentListener(new DocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void removeUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void changedUpdate(DocumentEvent e) {
- if (!reloading) {
- assignedToStatusLabel.setVisible(false);
- }
- }
- });
- }
-
- private void updateNoSummary() {
- if (summaryField.getText().trim().length() == 0) {
- if (!noSummary) {
- noSummary = true;
- updateMessagePanel();
- }
- } else {
- if (noSummary) {
- noSummary = false;
- updateMessagePanel();
- }
- }
- }
-
- private void updateInvalidKeyword() {
- boolean invalidFound = false;
- StringTokenizer st = new StringTokenizer(keywordsField.getText(), ", \t\n\r\f"); // NOI18N
- while (st.hasMoreTokens()) {
- String token = st.nextToken();
- if (!keywords.contains(token.toUpperCase())) {
- invalidFound = true;
- break;
- }
- }
- if (invalidFound != invalidKeyword) {
- invalidKeyword = invalidFound;
- updateMessagePanel();
- }
- }
-
- private void updateNoComponent() {
- boolean newNoComponent = (componentCombo.getSelectedItem() == null);
- if (noComponent != newNoComponent) {
- noComponent = newNoComponent;
- updateMessagePanel();
- }
- }
-
- private void updateNoReproducibility() {
- boolean newNoReproducibility = (reproducibilityCombo.getSelectedItem() == null);
- if (noReproducibility != newNoReproducibility) {
- noReproducibility = newNoReproducibility;
- updateMessagePanel();
- }
- }
-
- private void updateNoVersion() {
- boolean newNoVersion = (versionCombo.getSelectedItem() == null);
- if (noVersion != newNoVersion) {
- noVersion = newNoVersion;
- updateMessagePanel();
- }
- }
-
- private void updateNoTargetMilestone() {
- boolean newNoTargetMilestone = (targetMilestoneCombo.getSelectedItem() == null);
- if (noTargetMilestione != newNoTargetMilestone) {
- noTargetMilestione = newNoTargetMilestone;
- updateMessagePanel();
- }
- }
-
- private boolean noSummary = false;
- private boolean invalidKeyword = false;
- private boolean cyclicDependency = false;
- private boolean noComponent = false;
- private boolean noReproducibility = false;
- private boolean noVersion = false;
- private boolean noTargetMilestione = false;
- private boolean noDuplicateId = false;
- private final Map fieldsConflict = new LinkedHashMap<>();
- private final Map fieldsIncoming = new LinkedHashMap<>();
- private final Map fieldsLocal = new LinkedHashMap<>();
- private final TooltipsMap tooltipsConflict = new TooltipsMap();
- private final TooltipsMap tooltipsIncoming = new TooltipsMap();
- private final TooltipsMap tooltipsLocal = new TooltipsMap();
- private void updateMessagePanel() {
- messagePanel.removeAll();
- if (noComponent) {
- addMessage("IssuePanel.noComponent"); // NOI18N
- }
- if (noVersion) {
- addMessage("IssuePanel.noVersion"); // NOI18N
- }
- if (noTargetMilestione) {
- addMessage("IssuePanel.noTargetMilestone"); // NOI18N
- }
- if (noReproducibility && issue.isNew()) {
- addMessage("IssuePanel.noReproducibility"); // NOI18N
- }
- if (noSummary) {
- JLabel noSummaryLabel = new JLabel();
- noSummaryLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.noSummary")); // NOI18N
- String icon = issue.isNew() ? "org/netbeans/modules/bugzilla/resources/info.png" : "org/netbeans/modules/bugzilla/resources/error.gif"; // NOI18N
- noSummaryLabel.setIcon(ImageUtilities.loadImageIcon(icon, false));
- messagePanel.add(noSummaryLabel);
- }
- if (cyclicDependency) {
- JLabel cyclicDependencyLabel = new JLabel();
- cyclicDependencyLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.cyclicDependency")); // NOI18N
- cyclicDependencyLabel.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/error.gif", false)); // NOI18N
- messagePanel.add(cyclicDependencyLabel);
- }
- if (invalidKeyword) {
- JLabel invalidKeywordLabel = new JLabel();
- invalidKeywordLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.invalidKeyword")); // NOI18N
- invalidKeywordLabel.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/error.gif", false)); // NOI18N
- messagePanel.add(invalidKeywordLabel);
- }
- if (noDuplicateId) {
- JLabel noDuplicateLabel = new JLabel();
- noDuplicateLabel.setText(NbBundle.getMessage(IssuePanel.class, "IssuePanel.noDuplicateId")); // NOI18N
- noDuplicateLabel.setIcon(ImageUtilities.loadImageIcon("org/netbeans/modules/bugzilla/resources/error.gif", false)); // NOI18N
- messagePanel.add(noDuplicateLabel);
- }
- if (noSummary || cyclicDependency || invalidKeyword || noComponent || noVersion || noTargetMilestione || noDuplicateId || (noReproducibility && issue.isNew())) {
- submitButton.setEnabled(false);
- } else {
- submitButton.setEnabled(true);
- }
- for (Pair, ImageIcon> p : new Pair[] {
- Pair.of(fieldsConflict, ICON_CONFLICT),
- Pair.of(fieldsIncoming, ICON_REMOTE),
- Pair.of(fieldsLocal, ICON_UNSUBMITTED)
- }) {
- for (Map.Entry e : p.first().entrySet()) {
- JLabel lbl = new JLabel(e.getValue());
- lbl.setIcon(p.second());
- messagePanel.add(lbl);
- }
- }
- if (noSummary || cyclicDependency || invalidKeyword || noComponent || noVersion || noTargetMilestione || noDuplicateId || (noReproducibility && issue.isNew())
- || (fieldsConflict.size() + fieldsIncoming.size() + fieldsLocal.size() > 0)) {
- messagePanel.setVisible(true);
- messagePanel.revalidate();
- } else {
- messagePanel.setVisible(false);
- }
- }
-
- void addMessage(String messageKey) {
- JLabel messageLabel = new JLabel();
- messageLabel.setText(NbBundle.getMessage(IssuePanel.class, messageKey));
- String icon = issue.isNew() ? "org/netbeans/modules/bugzilla/resources/info.png" : "org/netbeans/modules/bugzilla/resources/error.gif"; // NOI18N
- messageLabel.setIcon(ImageUtilities.loadImageIcon(icon, false));
- messagePanel.add(messageLabel);
- }
-
- private Map enableMap = new HashMap<>();
- private void enableComponents(boolean enable) {
- enableComponents(this, enable);
- if (enable) {
- enableMap.clear();
- }
- }
-
- private void enableComponents(Component comp, boolean enable) {
- if (comp instanceof Container) {
- for (Component subComp : ((Container)comp).getComponents()) {
- enableComponents(subComp, enable);
- }
- }
- if ((comp instanceof JComboBox)
- || ((comp instanceof JTextComponent) && ((JTextComponent)comp).isEditable())
- || (comp instanceof AbstractButton) || (comp instanceof JList)) {
- if (enable) {
- Boolean b = enableMap.get(comp);
- if (b != null) {
- comp.setEnabled(b);
- } else {
- comp.setEnabled(true);
- }
- } else {
- enableMap.put(comp, comp.isEnabled());
- comp.setEnabled(false);
- }
- }
- }
-
- private void initSpellChecker () {
- Spellchecker.register(summaryField);
- Spellchecker.register(addCommentArea);
- Spellchecker.register(privateNotesField);
- }
-
- private List customFields = new LinkedList<>();
- private void initCustomFields() {
- customFields.clear();
- customFieldsPanelLeft.removeAll();
- customFieldsPanelRight.removeAll();
- GroupLayout labelLayout = new GroupLayout(customFieldsPanelLeft);
- customFieldsPanelLeft.setLayout(labelLayout);
- GroupLayout fieldLayout = new GroupLayout(customFieldsPanelRight);
- customFieldsPanelRight.setLayout(fieldLayout);
- GroupLayout.ParallelGroup labelHorizontalGroup = labelLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
- GroupLayout.SequentialGroup labelVerticalGroup = labelLayout.createSequentialGroup();
- GroupLayout.ParallelGroup fieldHorizontalGroup = fieldLayout.createParallelGroup(GroupLayout.Alignment.LEADING);
- GroupLayout.SequentialGroup fieldVerticalGroup = fieldLayout.createSequentialGroup();
- boolean nbRepository = BugzillaUtil.isNbRepository(issue.getRepository());
- boolean newIssue = issue.isNew();
- boolean anyField = false;
- for (IssueField field : issue.getRepository().getConfiguration().getFields()) {
- if (field instanceof CustomIssueField) {
- CustomIssueField cField = (CustomIssueField)field;
- if ((nbRepository && cField.getKey().equals(IssueField.ISSUE_TYPE.getKey()))
- || (newIssue && !cField.getShowOnBugCreation()) // NB IssueProvider type is already among non-custom fields
- || (isNbExceptionReport(field) && (newIssue || "".equals(issue.getFieldValue(field).trim())))) // NOI18N do not show exception reporter field - issue #212182
- {
- continue;
- }
- JLabel label = new JLabel(cField.getDisplayName()+":"); // NOI18N
- JComponent comp;
- JComponent editor;
- boolean rigid = false;
- switch (cField.getType()) {
- case LargeText:
- JScrollPane scrollPane = new JScrollPane();
- JTextArea textArea = new JTextArea();
- textArea.setRows(5);
- scrollPane.setViewportView(textArea);
- comp = scrollPane;
- editor = textArea;
- label.setVerticalAlignment(SwingConstants.TOP);
- UIUtils.fixFocusTraversalKeys(textArea);
- UIUtils.issue163946Hack(scrollPane);
- break;
- case FreeText:
- if(isNbExceptionReport(field)) {
- final String val = issue.getFieldValue(field);
- LinkButton lb = new LinkButton(val);
- lb.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- try {
- URL url = new URL("http://statistics.netbeans.org/exceptions/detail.do?id=" + val); // NOI18N
- HtmlBrowser.URLDisplayer.getDefault().showURL(url);
- } catch (MalformedURLException muex) {
- Bugzilla.LOG.log(Level.INFO, "Unable to show the exception report in the browser.", muex); // NOI18N
- }
- }
- });
- comp = editor = lb;
- } else {
- comp = editor = new JTextField();
- }
- break;
- case MultipleSelection:
- JList list = new JList();
- DefaultComboBoxModel model = new DefaultComboBoxModel(cField.getOptions().toArray());
- list.setModel(model);
- if (model.getSize()//GEN-BEGIN:initComponents
- private void initComponents() {
-
- productField = new javax.swing.JTextField();
- resolutionCombo = new javax.swing.JComboBox();
- assignedCombo = new javax.swing.JComboBox();
- timetrackingPanel = new javax.swing.JPanel();
- estimatedLabel = new javax.swing.JLabel();
- estimatedField = new javax.swing.JTextField();
- estimatedWarning = new javax.swing.JLabel();
- actualLabel = new javax.swing.JLabel();
- workedLabel = new javax.swing.JLabel();
- workedField = new javax.swing.JTextField();
- workedWarning = new javax.swing.JLabel();
- remainingField = new javax.swing.JTextField();
- remainingLabel = new javax.swing.JLabel();
- remainingWarning = new javax.swing.JLabel();
- completeLabel = new javax.swing.JLabel();
- workedSumField = new javax.swing.JLabel();
- jLabel7 = new javax.swing.JLabel();
- actualField = new javax.swing.JTextField();
- completeField = new javax.swing.JTextField();
- gainLabel = new javax.swing.JLabel();
- gainField = new javax.swing.JTextField();
- deadlineLabel = new javax.swing.JLabel();
- dummyDeadlineField = new javax.swing.JTextField();
- actualWarning = new javax.swing.JLabel();
- deadlineWarning = new javax.swing.JLabel();
- completeWarning = new javax.swing.JLabel();
- gainWarning = new javax.swing.JLabel();
- attributesSectionPanel = new javax.swing.JPanel();
- duplicateWarning = new javax.swing.JLabel();
- reportedLabel = new javax.swing.JLabel();
- osCombo = new javax.swing.JComboBox();
- blocksWarning = new javax.swing.JLabel();
- dependsOnButton = new javax.swing.JButton();
- componentCombo = new javax.swing.JComboBox();
- qaContactField = new javax.swing.JTextField();
- blocksLabel = new javax.swing.JLabel();
- customFieldsPanelLeft = new javax.swing.JPanel();
- versionLabel = new javax.swing.JLabel();
- statusWhiteboardLabel = new javax.swing.JLabel();
- platformWarning = new javax.swing.JLabel();
- statusWarning = new javax.swing.JLabel();
- urlLabel = new org.netbeans.modules.bugtracking.commons.LinkButton();
- priorityLabel = new javax.swing.JLabel();
- modifiedField = new javax.swing.JTextField();
- targetMilestoneLabel = new javax.swing.JLabel();
- summaryWarning = new javax.swing.JLabel();
- productLabel = new javax.swing.JLabel();
- assignedToWarning = new javax.swing.JLabel();
- issueTypeWarning = new javax.swing.JLabel();
- issueTypeLabel = new javax.swing.JLabel();
- statusLabel = new javax.swing.JLabel();
- dependsLabel = new javax.swing.JLabel();
- ccWarning = new javax.swing.JLabel();
- platformLabel = new javax.swing.JLabel();
- keywordsLabel = new javax.swing.JLabel();
- componentLabel = new javax.swing.JLabel();
- assignedLabel = new javax.swing.JLabel();
- duplicateField = new javax.swing.JTextField();
- priorityCombo = new javax.swing.JComboBox();
- resolutionWarning = new javax.swing.JLabel();
- issueTypeCombo = new javax.swing.JComboBox();
- productWarning = new javax.swing.JLabel();
- summaryField = new javax.swing.JTextField();
- assignedField = new javax.swing.JTextField();
- dummyTimetrackingPanel = new javax.swing.JPanel();
- summaryLabel = new javax.swing.JLabel();
- assignedToStatusLabel = new javax.swing.JLabel();
- blocksButton = new javax.swing.JButton();
- duplicateButton = new javax.swing.JButton();
- milestoneWarning = new javax.swing.JLabel();
- dummyLabel2 = new javax.swing.JLabel();
- assignToDefaultCheckBox = new javax.swing.JCheckBox();
- modifiedLabel = new javax.swing.JLabel();
- urlField = new javax.swing.JTextField();
- customFieldsPanelRight = new javax.swing.JPanel();
- ccLabel = new javax.swing.JLabel();
- ccField = new javax.swing.JTextField();
- blocksField = new javax.swing.JTextField();
- dependsField = new javax.swing.JTextField();
- productCombo = new javax.swing.JComboBox();
- componentWarning = new javax.swing.JLabel();
- versionCombo = new javax.swing.JComboBox();
- dummyLabel1 = new javax.swing.JLabel();
- dummyLabel3 = new javax.swing.JLabel();
- timetrackingLabel = new javax.swing.JLabel();
- dependsOnWarning = new javax.swing.JLabel();
- platformCombo = new javax.swing.JComboBox();
- severityCombo = new javax.swing.JComboBox();
- resolutionLabel = new javax.swing.JLabel();
- resolutionField = new javax.swing.JTextField();
- targetMilestoneCombo = new javax.swing.JComboBox();
- reproducibilityLabel = new javax.swing.JLabel();
- reproducibilityCombo = new javax.swing.JComboBox();
- statusWhiteboardField = new javax.swing.JTextField();
- priorityWarning = new javax.swing.JLabel();
- statusWhiteboardWarning = new javax.swing.JLabel();
- reportedField = new javax.swing.JTextField();
- urlWarning = new javax.swing.JLabel();
- timetrackingWarning = new javax.swing.JLabel();
- statusCombo = new javax.swing.JComboBox();
- keywordsField = new javax.swing.JTextField();
- reportedStatusLabel = new javax.swing.JLabel();
- dummyTimetrackingLabel = new javax.swing.JLabel();
- qaContactLabel = new javax.swing.JLabel();
- versionWarning = new javax.swing.JLabel();
- duplicateLabel = new javax.swing.JLabel();
- keywordsButton = new javax.swing.JButton();
- keywordsWarning = new javax.swing.JLabel();
- qaContactWarning = new javax.swing.JLabel();
- attachmentsSectionPanel = new javax.swing.JPanel();
- attachmentsWarning = new javax.swing.JLabel();
- dummyAttachmentsPanel = new javax.swing.JPanel();
- commentsSectionPanel = new javax.swing.JPanel();
- dummyCommentsPanel = new javax.swing.JPanel();
- newCommentSectionPanel = new javax.swing.JPanel();
- scrollPane1 = new javax.swing.JScrollPane();
- addCommentArea = new javax.swing.JTextArea() {
- @Override
- public Dimension getPreferredScrollableViewportSize() {
- Dimension dim = super.getPreferredScrollableViewportSize();
- JScrollPane scrollPane = (JScrollPane)SwingUtilities.getAncestorOfClass(JScrollPane.class, this);
- int delta = 0;
- if (scrollPane != null) {
- Component comp = scrollPane.getHorizontalScrollBar();
- delta = comp.isVisible() ? comp.getHeight() : 0;
- }
- Insets insets = getInsets();
- int prefHeight = 5 * getRowHeight() + insets.top + insets.bottom;
- dim = new Dimension(0, delta + ((dim.height < prefHeight) ? prefHeight : dim.height));
- return dim;
- }
- };
- attachLogCheckBox = new javax.swing.JCheckBox();
- viewLogButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- commentWarning = new javax.swing.JLabel();
- messagePanel = new javax.swing.JPanel();
- privatePanel = new javax.swing.JPanel();
- dueDateLabel = new javax.swing.JLabel();
- dummyDueDateField = new javax.swing.JTextField();
- scheduleDateLabel = new javax.swing.JLabel();
- dummyScheduleDateField = new javax.swing.JTextField();
- estimateLabel = new javax.swing.JLabel();
- estimateField = new javax.swing.JFormattedTextField();
- notesLabel = new javax.swing.JLabel();
- privateNotesScrollPane = new javax.swing.JScrollPane();
- privateNotesField = new javax.swing.JTextArea() {
- @Override
- public Dimension getPreferredScrollableViewportSize() {
- Dimension dim = super.getPreferredScrollableViewportSize();
- JScrollPane scrollPane = (JScrollPane)SwingUtilities.getAncestorOfClass(JScrollPane.class, this);
- int delta = 0;
- if (scrollPane != null) {
- Component comp = scrollPane.getHorizontalScrollBar();
- delta = comp.isVisible() ? comp.getHeight() : 0;
- }
- Insets insets = getInsets();
- int prefHeight = 5 * getRowHeight() + insets.top + insets.bottom;
- dim = new Dimension(0, delta + ((dim.height < prefHeight) ? prefHeight : dim.height));
- return dim;
- }
- };
- jComboBox1 = new javax.swing.JComboBox();
- headerPanel = new javax.swing.JPanel();
- headerField = new javax.swing.JTextField();
- buttonsPanel = new javax.swing.JPanel();
- separatorLabel4 = new javax.swing.JLabel();
- separatorLabel6 = new javax.swing.JLabel();
- separatorLabel3 = new javax.swing.JLabel();
- separatorDismissButton = new javax.swing.JLabel();
- refreshButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- cancelButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- showInBrowserButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- submitButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- btnDeleteTask = new org.netbeans.modules.bugtracking.commons.LinkButton();
- mainScrollPane = new javax.swing.JScrollPane();
- mainPanel = new javax.swing.JPanel();
- attributesSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel();
- attachmentsSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel();
- newCommentSection = new org.netbeans.modules.bugtracking.commons.SectionPanel();
- jPanel1 = new javax.swing.JPanel() {
-
- @Override
- public Dimension getPreferredSize () {
- return getMinimumSize();
- }
- }
- ;
- commentsSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel();
- privateSection = new org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel();
-
- FormListener formListener = new FormListener();
-
- productField.setEditable(false);
- productField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
- productField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.productField.AccessibleContext.accessibleDescription")); // NOI18N
-
- resolutionCombo.addActionListener(formListener);
- resolutionCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.resolutionCombo.AccessibleContext.accessibleDescription")); // NOI18N
-
- assignedCombo.setEditable(true);
- assignedCombo.addActionListener(formListener);
-
- timetrackingPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- org.openide.awt.Mnemonics.setLocalizedText(estimatedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimatedLabel.text")); // NOI18N
-
- estimatedField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimatedField.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(actualLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.actualLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(workedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.workedLabel.text")); // NOI18N
-
- workedField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.workedField.text")); // NOI18N
- workedField.addFocusListener(formListener);
-
- remainingField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.remainingField.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(remainingLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.remainingLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(completeLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.completeLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(workedSumField, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.workedSumField.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.jLabel7.text")); // NOI18N
-
- actualField.setEditable(false);
- actualField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.actualField.text")); // NOI18N
-
- completeField.setEditable(false);
- completeField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.completeField.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(gainLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.gainLabel.text")); // NOI18N
-
- gainField.setEditable(false);
- gainField.setText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.gainField.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(deadlineLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.deadlineLabel.text")); // NOI18N
-
- javax.swing.GroupLayout timetrackingPanelLayout = new javax.swing.GroupLayout(timetrackingPanel);
- timetrackingPanel.setLayout(timetrackingPanelLayout);
- timetrackingPanelLayout.setHorizontalGroup(
- timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(estimatedLabel)
- .addComponent(estimatedField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(estimatedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(actualLabel)
- .addComponent(actualField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(actualWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addComponent(workedSumField)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel7)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(workedField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(workedLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(workedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(remainingLabel)
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addComponent(remainingField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(6, 6, 6)
- .addComponent(remainingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(completeLabel)
- .addComponent(completeField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(completeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addComponent(gainField, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(gainWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(9, 9, 9)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(dummyDeadlineField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(deadlineLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(deadlineWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(gainLabel)))
- );
- timetrackingPanelLayout.setVerticalGroup(
- timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(completeLabel)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(actualLabel, javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(estimatedLabel)
- .addComponent(remainingLabel))
- .addComponent(workedLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(actualWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(remainingField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(workedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(estimatedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(deadlineWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(completeField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel7)
- .addComponent(actualField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(estimatedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(remainingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(workedWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(workedSumField)
- .addComponent(completeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addComponent(gainLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(timetrackingPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(gainField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(gainWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGroup(timetrackingPanelLayout.createSequentialGroup()
- .addComponent(deadlineLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(dummyDeadlineField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
-
- attributesSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- reportedLabel.setLabelFor(reportedField);
- org.openide.awt.Mnemonics.setLocalizedText(reportedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.reportedLabel.text")); // NOI18N
-
- osCombo.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(dependsOnButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsOnButton.text")); // NOI18N
- dependsOnButton.setFocusPainted(false);
- dependsOnButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
- dependsOnButton.addActionListener(formListener);
-
- componentCombo.addActionListener(formListener);
-
- blocksLabel.setLabelFor(blocksField);
- org.openide.awt.Mnemonics.setLocalizedText(blocksLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksLabel.text")); // NOI18N
-
- versionLabel.setLabelFor(versionCombo);
- org.openide.awt.Mnemonics.setLocalizedText(versionLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.versionLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(statusWhiteboardLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.statusWhiteboardLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(urlLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.urlLabel.text")); // NOI18N
- urlLabel.addActionListener(formListener);
-
- priorityLabel.setLabelFor(priorityCombo);
- org.openide.awt.Mnemonics.setLocalizedText(priorityLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.priorityLabel.text")); // NOI18N
-
- modifiedField.setEditable(false);
- modifiedField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-
- targetMilestoneLabel.setLabelFor(targetMilestoneCombo);
- org.openide.awt.Mnemonics.setLocalizedText(targetMilestoneLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.targetMilestoneLabel.text")); // NOI18N
-
- productLabel.setLabelFor(productCombo);
- org.openide.awt.Mnemonics.setLocalizedText(productLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.productLabel.text")); // NOI18N
-
- issueTypeLabel.setLabelFor(issueTypeCombo);
- org.openide.awt.Mnemonics.setLocalizedText(issueTypeLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.issueTypeLabel.text")); // NOI18N
-
- statusLabel.setLabelFor(statusCombo);
- org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.statusLabel.text")); // NOI18N
-
- dependsLabel.setLabelFor(dependsField);
- org.openide.awt.Mnemonics.setLocalizedText(dependsLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsLabel.text")); // NOI18N
-
- platformLabel.setLabelFor(platformCombo);
- org.openide.awt.Mnemonics.setLocalizedText(platformLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.platformLabel.text")); // NOI18N
-
- keywordsLabel.setLabelFor(keywordsField);
- org.openide.awt.Mnemonics.setLocalizedText(keywordsLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsLabel.text")); // NOI18N
-
- componentLabel.setLabelFor(componentCombo);
- org.openide.awt.Mnemonics.setLocalizedText(componentLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.componentLabel.text")); // NOI18N
-
- assignedLabel.setLabelFor(assignedField);
- org.openide.awt.Mnemonics.setLocalizedText(assignedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.assignedLabel.text")); // NOI18N
-
- duplicateField.setColumns(15);
-
- priorityCombo.addActionListener(formListener);
-
- issueTypeCombo.addActionListener(formListener);
-
- summaryLabel.setLabelFor(summaryField);
- org.openide.awt.Mnemonics.setLocalizedText(summaryLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.summaryLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(blocksButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.text")); // NOI18N
- blocksButton.setFocusPainted(false);
- blocksButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
- blocksButton.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(duplicateButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.text")); // NOI18N
- duplicateButton.setFocusPainted(false);
- duplicateButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
- duplicateButton.addActionListener(formListener);
-
- assignToDefaultCheckBox.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- org.openide.awt.Mnemonics.setLocalizedText(assignToDefaultCheckBox, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.assignToDefaultCheckBox.text")); // NOI18N
-
- modifiedLabel.setLabelFor(modifiedField);
- org.openide.awt.Mnemonics.setLocalizedText(modifiedLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.modifiedLabel.text")); // NOI18N
-
- urlField.setColumns(15);
-
- ccLabel.setLabelFor(ccField);
- org.openide.awt.Mnemonics.setLocalizedText(ccLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.ccLabel.text")); // NOI18N
-
- blocksField.setColumns(15);
-
- dependsField.setColumns(15);
-
- productCombo.addActionListener(formListener);
-
- versionCombo.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(timetrackingLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.timetrackingLabel.text")); // NOI18N
-
- platformCombo.addActionListener(formListener);
-
- severityCombo.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(resolutionLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.resolutionLabel.text")); // NOI18N
-
- resolutionField.setEditable(false);
- resolutionField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-
- targetMilestoneCombo.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(reproducibilityLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.reproducibilityLabel.text")); // NOI18N
-
- reproducibilityCombo.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
- reproducibilityCombo.addActionListener(formListener);
-
- statusWhiteboardField.setColumns(15);
-
- reportedField.setEditable(false);
- reportedField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-
- statusCombo.addActionListener(formListener);
-
- keywordsField.setColumns(15);
-
- qaContactLabel.setLabelFor(qaContactField);
- org.openide.awt.Mnemonics.setLocalizedText(qaContactLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.qaContactLabel.text")); // NOI18N
-
- duplicateLabel.setLabelFor(duplicateField);
- org.openide.awt.Mnemonics.setLocalizedText(duplicateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(keywordsButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsButton.text")); // NOI18N
- keywordsButton.setFocusPainted(false);
- keywordsButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
- keywordsButton.addActionListener(formListener);
-
- javax.swing.GroupLayout attributesSectionPanelLayout = new javax.swing.GroupLayout(attributesSectionPanel);
- attributesSectionPanel.setLayout(attributesSectionPanelLayout);
- attributesSectionPanelLayout.setHorizontalGroup(
- attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(statusWhiteboardWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(keywordsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(urlWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(milestoneWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(issueTypeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(versionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(componentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(productWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(summaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(timetrackingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(5, 5, 5)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(keywordsLabel)
- .addComponent(statusWhiteboardLabel)
- .addComponent(timetrackingLabel)
- .addComponent(summaryLabel)
- .addComponent(urlLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(issueTypeLabel)
- .addComponent(versionLabel)
- .addComponent(componentLabel)
- .addComponent(productLabel)
- .addComponent(targetMilestoneLabel)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(reproducibilityLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(dummyLabel2))))
- .addComponent(customFieldsPanelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(platformWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(5, 5, 5)
- .addComponent(platformLabel))
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(priorityWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(priorityLabel)))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(dummyTimetrackingPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(customFieldsPanelRight, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(keywordsField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(keywordsButton))
- .addComponent(urlField)
- .addComponent(targetMilestoneCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(issueTypeCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(versionCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(componentCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(productCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(platformCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(osCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(priorityCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(severityCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addComponent(reproducibilityCombo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(assignedToWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(qaContactWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(ccWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(statusWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(resolutionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(duplicateWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(dependsOnWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(blocksWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(5, 5, 5)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(reportedLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(reportedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(reportedStatusLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(modifiedLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(modifiedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(blocksLabel)
- .addComponent(dependsLabel)
- .addComponent(duplicateLabel)
- .addComponent(resolutionLabel)
- .addComponent(statusLabel)
- .addComponent(ccLabel)
- .addComponent(qaContactLabel)
- .addComponent(assignedLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(ccField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(assignedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(statusCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(assignToDefaultCheckBox)
- .addComponent(qaContactField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(resolutionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(blocksField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
- .addComponent(dependsField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE)
- .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(duplicateButton, javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(dependsOnButton, javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(blocksButton, javax.swing.GroupLayout.Alignment.TRAILING))))
- .addGap(18, 18, Short.MAX_VALUE)
- .addComponent(assignedToStatusLabel))))
- .addComponent(summaryField)
- .addComponent(statusWhiteboardField)))
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(dummyLabel1)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addComponent(dummyLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 176, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(dummyTimetrackingLabel)))
- .addGap(300, 300, 300))
- );
-
- attributesSectionPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {osCombo, platformCombo, priorityCombo, severityCombo});
-
- attributesSectionPanelLayout.linkSize(javax.swing.SwingConstants.HORIZONTAL, new java.awt.Component[] {assignedField, ccField, componentCombo, issueTypeCombo, productCombo, qaContactField, resolutionField, statusCombo, targetMilestoneCombo, urlField, versionCombo});
-
- attributesSectionPanelLayout.setVerticalGroup(
- attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(reportedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(reportedStatusLabel)
- .addComponent(modifiedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(modifiedLabel)
- .addComponent(productWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(productLabel)
- .addComponent(productCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(reportedLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(componentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(componentLabel)
- .addComponent(componentCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(assignedToWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(assignedLabel)
- .addComponent(assignedField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(versionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(versionLabel)
- .addComponent(versionCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(assignToDefaultCheckBox))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(platformWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(platformLabel)
- .addComponent(platformCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(osCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(qaContactWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(qaContactLabel)
- .addComponent(qaContactField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(issueTypeWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(issueTypeLabel)
- .addComponent(issueTypeCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(ccWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(ccLabel)
- .addComponent(ccField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(dummyLabel1)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(priorityLabel)
- .addComponent(priorityWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(priorityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(severityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(statusLabel)
- .addComponent(statusWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(statusCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(milestoneWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(targetMilestoneLabel)
- .addComponent(targetMilestoneCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(resolutionWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(resolutionLabel)
- .addComponent(resolutionField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(duplicateWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(duplicateLabel)
- .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(duplicateButton)
- .addComponent(dummyLabel2)
- .addComponent(reproducibilityLabel)
- .addComponent(reproducibilityCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(urlWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(urlLabel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(urlField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(dependsOnWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(dependsLabel)
- .addComponent(dependsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(dependsOnButton))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(keywordsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(keywordsLabel)
- .addComponent(keywordsField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(keywordsButton)
- .addComponent(blocksLabel)
- .addComponent(blocksWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(blocksField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(blocksButton))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(statusWhiteboardWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(statusWhiteboardLabel)
- .addComponent(statusWhiteboardField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGroup(attributesSectionPanelLayout.createSequentialGroup()
- .addGap(25, 25, 25)
- .addComponent(assignedToStatusLabel)))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(timetrackingWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(timetrackingLabel))
- .addComponent(dummyTimetrackingPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(dummyTimetrackingLabel)
- .addComponent(dummyLabel3))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(customFieldsPanelRight, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(customFieldsPanelLeft, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addGroup(attributesSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(summaryWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(summaryLabel)
- .addComponent(summaryField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(0, 0, Short.MAX_VALUE))
- );
-
- attributesSectionPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {dummyLabel1, dummyLabel2, dummyLabel3, dummyTimetrackingLabel, priorityCombo});
-
- osCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.osCombo.AccessibleContext.accessibleDescription")); // NOI18N
- dependsOnButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsOnButton.AccessibleContext.accessibleDescription")); // NOI18N
- componentCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.componentCombo.AccessibleContext.accessibleDescription")); // NOI18N
- qaContactField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.qaContactField.AccessibleContext.accessibleDescription")); // NOI18N
- modifiedField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.modifiedField.AccessibleContext.accessibleDescription")); // NOI18N
- duplicateField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateField.AccessibleContext.accessibleDescription")); // NOI18N
- priorityCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.priorityCombo.AccessibleContext.accessibleDescription")); // NOI18N
- assignedField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.assignedField.AccessibleContext.accessibleDescription")); // NOI18N
- blocksButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.AccessibleContext.accessibleDescription")); // NOI18N
- duplicateButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.AccessibleContext.accessibleDescription")); // NOI18N
- urlField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.urlField.AccessibleContext.accessibleDescription")); // NOI18N
- ccField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.ccField.AccessibleContext.accessibleDescription")); // NOI18N
- blocksField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksField.AccessibleContext.accessibleDescription")); // NOI18N
- dependsField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsField.AccessibleContext.accessibleDescription")); // NOI18N
- productCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.productCombo.AccessibleContext.accessibleDescription")); // NOI18N
- versionCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.versionCombo.AccessibleContext.accessibleDescription")); // NOI18N
- platformCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.platformCombo.AccessibleContext.accessibleDescription")); // NOI18N
- severityCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.severityCombo.AccessibleContext.accessibleDescription")); // NOI18N
- resolutionField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.resolutionField.AccessibleContext.accessibleDescription")); // NOI18N
- targetMilestoneCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.targetMilestoneCombo.AccessibleContext.accessibleDescription")); // NOI18N
- reportedField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.reportedField.AccessibleContext.accessibleDescription")); // NOI18N
- statusCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.statusCombo.AccessibleContext.accessibleDescription")); // NOI18N
- keywordsField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsField.AccessibleContext.accessibleDescription")); // NOI18N
- keywordsButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- attachmentsSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- attachmentsWarning.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- javax.swing.GroupLayout attachmentsSectionPanelLayout = new javax.swing.GroupLayout(attachmentsSectionPanel);
- attachmentsSectionPanel.setLayout(attachmentsSectionPanelLayout);
- attachmentsSectionPanelLayout.setHorizontalGroup(
- attachmentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attachmentsSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(attachmentsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(5, 5, 5)
- .addComponent(dummyAttachmentsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(0, 0, 0))
- );
- attachmentsSectionPanelLayout.setVerticalGroup(
- attachmentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(attachmentsSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addGroup(attachmentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(dummyAttachmentsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(attachmentsWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(0, 0, 0))
- );
-
- commentsSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- javax.swing.GroupLayout commentsSectionPanelLayout = new javax.swing.GroupLayout(commentsSectionPanel);
- commentsSectionPanel.setLayout(commentsSectionPanelLayout);
- commentsSectionPanelLayout.setHorizontalGroup(
- commentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(commentsSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(dummyCommentsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(0, 0, 0))
- );
- commentsSectionPanelLayout.setVerticalGroup(
- commentsSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(commentsSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(dummyCommentsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(0, 0, 0))
- );
-
- newCommentSectionPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- scrollPane1.setVerticalScrollBarPolicy(javax.swing.ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
-
- addCommentArea.setLineWrap(true);
- addCommentArea.setWrapStyleWord(true);
- scrollPane1.setViewportView(addCommentArea);
- addCommentArea.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.addCommentArea.AccessibleContext.accessibleDescription")); // NOI18N
-
- attachLogCheckBox.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- org.openide.awt.Mnemonics.setLocalizedText(attachLogCheckBox, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.attachLogCheckBox.text")); // NOI18N
- attachLogCheckBox.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(viewLogButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.viewLogButton.text")); // NOI18N
- viewLogButton.addActionListener(formListener);
-
- messagePanel.setLayout(new javax.swing.BoxLayout(messagePanel, javax.swing.BoxLayout.PAGE_AXIS));
-
- javax.swing.GroupLayout newCommentSectionPanelLayout = new javax.swing.GroupLayout(newCommentSectionPanel);
- newCommentSectionPanel.setLayout(newCommentSectionPanelLayout);
- newCommentSectionPanelLayout.setHorizontalGroup(
- newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(newCommentSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(commentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(5, 5, 5)
- .addGroup(newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(messagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(newCommentSectionPanelLayout.createSequentialGroup()
- .addComponent(attachLogCheckBox)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(viewLogButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(scrollPane1))
- .addGap(0, 0, 0))
- );
- newCommentSectionPanelLayout.setVerticalGroup(
- newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(newCommentSectionPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addGroup(newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(commentWarning, javax.swing.GroupLayout.PREFERRED_SIZE, 16, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(scrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(newCommentSectionPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(viewLogButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(attachLogCheckBox))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(messagePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(0, 0, 0))
- );
-
- privatePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- dueDateLabel.setLabelFor(dummyDueDateField);
- org.openide.awt.Mnemonics.setLocalizedText(dueDateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dueDateLabel.text")); // NOI18N
- dueDateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.dueDateLabel.TTtext")); // NOI18N
-
- scheduleDateLabel.setLabelFor(dummyScheduleDateField);
- org.openide.awt.Mnemonics.setLocalizedText(scheduleDateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.scheduleDateLabel.text")); // NOI18N
- scheduleDateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.scheduleDateLabel.TTtext")); // NOI18N
-
- estimateLabel.setLabelFor(estimatedField);
- org.openide.awt.Mnemonics.setLocalizedText(estimateLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimateLabel.text")); // NOI18N
- estimateLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimateLabel.TTtext")); // NOI18N
-
- estimateField.setFormatterFactory(new javax.swing.text.DefaultFormatterFactory(estimateFormatter));
- estimateField.setText("0");
- estimateField.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.estimateField.toolTipText")); // NOI18N
-
- notesLabel.setLabelFor(privateNotesField);
- org.openide.awt.Mnemonics.setLocalizedText(notesLabel, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.notesLabel.text")); // NOI18N
- notesLabel.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.notesLabel.TTtext")); // NOI18N
-
- privateNotesField.setColumns(20);
- privateNotesField.setLineWrap(true);
- privateNotesField.setWrapStyleWord(true);
- privateNotesScrollPane.setViewportView(privateNotesField);
-
- javax.swing.GroupLayout privatePanelLayout = new javax.swing.GroupLayout(privatePanel);
- privatePanel.setLayout(privatePanelLayout);
- privatePanelLayout.setHorizontalGroup(
- privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(privatePanelLayout.createSequentialGroup()
- .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addComponent(notesLabel)
- .addComponent(dueDateLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(privatePanelLayout.createSequentialGroup()
- .addComponent(dummyDueDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(scheduleDateLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(dummyScheduleDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(estimateLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(estimateField, javax.swing.GroupLayout.PREFERRED_SIZE, 65, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(privateNotesScrollPane)))
- );
- privatePanelLayout.setVerticalGroup(
- privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(privatePanelLayout.createSequentialGroup()
- .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(dueDateLabel)
- .addComponent(dummyDueDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(scheduleDateLabel)
- .addComponent(dummyScheduleDateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(estimateLabel)
- .addComponent(estimateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addGroup(privatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(notesLabel)
- .addComponent(privateNotesScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- );
-
- jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- headerPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- headerField.setEditable(false);
- headerField.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
-
- buttonsPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- separatorLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- separatorLabel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- separatorLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- separatorDismissButton.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshButton.text")); // NOI18N
- refreshButton.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshButton.toolTipText")); // NOI18N
- refreshButton.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(cancelButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.cancelButton.text")); // NOI18N
- cancelButton.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(showInBrowserButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.showInBrowserButton.text")); // NOI18N
- showInBrowserButton.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(submitButton, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitButton.text")); // NOI18N
- submitButton.addActionListener(formListener);
-
- org.openide.awt.Mnemonics.setLocalizedText(btnDeleteTask, org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.btnDeleteTask.text")); // NOI18N
- btnDeleteTask.setToolTipText(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.btnDeleteTask.TTtext")); // NOI18N
- btnDeleteTask.addActionListener(formListener);
-
- javax.swing.GroupLayout buttonsPanelLayout = new javax.swing.GroupLayout(buttonsPanel);
- buttonsPanel.setLayout(buttonsPanelLayout);
- buttonsPanelLayout.setHorizontalGroup(
- buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(buttonsPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(separatorLabel3)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(showInBrowserButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(separatorLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(submitButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(separatorLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(separatorDismissButton, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(btnDeleteTask, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0))
- );
- buttonsPanelLayout.setVerticalGroup(
- buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(buttonsPanelLayout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addGroup(buttonsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(refreshButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(separatorLabel3, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(showInBrowserButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(separatorLabel4, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(submitButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(cancelButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(separatorLabel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(btnDeleteTask, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(separatorDismissButton, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
- );
-
- buttonsPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {refreshButton, separatorLabel3, showInBrowserButton});
-
- refreshButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshButton.AccessibleContext.accessibleDescription")); // NOI18N
- cancelButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.cancelButton.AccessibleContext.accessibleDescription")); // NOI18N
- submitButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- javax.swing.GroupLayout headerPanelLayout = new javax.swing.GroupLayout(headerPanel);
- headerPanel.setLayout(headerPanelLayout);
- headerPanelLayout.setHorizontalGroup(
- headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(headerPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(headerField)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(buttonsPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
- headerPanelLayout.setVerticalGroup(
- headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(headerPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(headerPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(headerField)
- .addComponent(buttonsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap())
- );
-
- mainScrollPane.setBorder(null);
-
- mainPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- attributesSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- attributesSection.setActions(getAttributesSectionActions());
- attributesSection.setContent(attributesSectionPanel);
- attributesSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.attributesSection.label")); // NOI18N
-
- attachmentsSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- attachmentsSection.setContent(attachmentsSectionPanel);
- attachmentsSection.setExpanded(false);
- attachmentsSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.attachmentsLabel.text", 0)); // NOI18N
-
- newCommentSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- newCommentSection.setContent(newCommentSectionPanel);
- newCommentSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.newCommentSection.label")); // NOI18N
-
- jPanel1.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- commentsSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- commentsSection.setActions(getCommentsSectionActions());
- commentsSection.setContent(commentsSectionPanel);
- commentsSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.commentsLabel.text", 0)); // NOI18N
-
- javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
- jPanel1.setLayout(jPanel1Layout);
- jPanel1Layout.setHorizontalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(commentsSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(0, 0, 0))
- );
- jPanel1Layout.setVerticalGroup(
- jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(jPanel1Layout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(commentsSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGap(0, 0, 0))
- );
-
- privateSection.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- privateSection.setActions(getPrivateSectionActions());
- privateSection.setContent(privatePanel);
- privateSection.setLabel(org.openide.util.NbBundle.getMessage(IssuePanel.class, "IssuePanel.privateAttributesSection.text")); // NOI18N
-
- javax.swing.GroupLayout mainPanelLayout = new javax.swing.GroupLayout(mainPanel);
- mainPanel.setLayout(mainPanelLayout);
- mainPanelLayout.setHorizontalGroup(
- mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(attributesSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(attachmentsSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(privateSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(newCommentSection, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(jPanel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addContainerGap())
- );
- mainPanelLayout.setVerticalGroup(
- mainPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(mainPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(attributesSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(attachmentsSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(privateSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(newCommentSection, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- );
-
- mainScrollPane.setViewportView(mainPanel);
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(headerPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(mainScrollPane)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addGap(0, 0, 0)
- .addComponent(headerPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0)
- .addComponent(mainScrollPane))
- );
- }
-
- // Code for dispatching events from components to event handlers.
-
- private class FormListener implements java.awt.event.ActionListener, java.awt.event.FocusListener {
- FormListener() {}
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- if (evt.getSource() == refreshButton) {
- IssuePanel.this.refreshButtonActionPerformed(evt);
- }
- else if (evt.getSource() == cancelButton) {
- IssuePanel.this.cancelButtonActionPerformed(evt);
- }
- else if (evt.getSource() == showInBrowserButton) {
- IssuePanel.this.showInBrowserButtonActionPerformed(evt);
- }
- else if (evt.getSource() == submitButton) {
- IssuePanel.this.submitButtonActionPerformed(evt);
- }
- else if (evt.getSource() == btnDeleteTask) {
- IssuePanel.this.btnDeleteTaskActionPerformed(evt);
- }
- else if (evt.getSource() == resolutionCombo) {
- IssuePanel.this.resolutionComboActionPerformed(evt);
- }
- else if (evt.getSource() == assignedCombo) {
- IssuePanel.this.assignedComboActionPerformed(evt);
- }
- else if (evt.getSource() == osCombo) {
- IssuePanel.this.osComboActionPerformed(evt);
- }
- else if (evt.getSource() == dependsOnButton) {
- IssuePanel.this.dependsOnButtonActionPerformed(evt);
- }
- else if (evt.getSource() == componentCombo) {
- IssuePanel.this.componentComboActionPerformed(evt);
- }
- else if (evt.getSource() == urlLabel) {
- IssuePanel.this.urlButtonActionPerformed(evt);
- }
- else if (evt.getSource() == priorityCombo) {
- IssuePanel.this.priorityComboActionPerformed(evt);
- }
- else if (evt.getSource() == issueTypeCombo) {
- IssuePanel.this.issueTypeComboActionPerformed(evt);
- }
- else if (evt.getSource() == blocksButton) {
- IssuePanel.this.blocksButtonActionPerformed(evt);
- }
- else if (evt.getSource() == duplicateButton) {
- IssuePanel.this.duplicateButtonActionPerformed(evt);
- }
- else if (evt.getSource() == productCombo) {
- IssuePanel.this.productComboActionPerformed(evt);
- }
- else if (evt.getSource() == versionCombo) {
- IssuePanel.this.versionComboActionPerformed(evt);
- }
- else if (evt.getSource() == platformCombo) {
- IssuePanel.this.platformComboActionPerformed(evt);
- }
- else if (evt.getSource() == severityCombo) {
- IssuePanel.this.severityComboActionPerformed(evt);
- }
- else if (evt.getSource() == targetMilestoneCombo) {
- IssuePanel.this.targetMilestoneComboActionPerformed(evt);
- }
- else if (evt.getSource() == statusCombo) {
- IssuePanel.this.statusComboActionPerformed(evt);
- }
- else if (evt.getSource() == keywordsButton) {
- IssuePanel.this.keywordsButtonActionPerformed(evt);
- }
- else if (evt.getSource() == attachLogCheckBox) {
- IssuePanel.this.attachLogCheckBoxActionPerformed(evt);
- }
- else if (evt.getSource() == viewLogButton) {
- IssuePanel.this.viewLogButtonActionPerformed(evt);
- }
- else if (evt.getSource() == reproducibilityCombo) {
- IssuePanel.this.reproducibilityComboActionPerformed(evt);
- }
- }
-
- public void focusGained(java.awt.event.FocusEvent evt) {
- }
-
- public void focusLost(java.awt.event.FocusEvent evt) {
- if (evt.getSource() == workedField) {
- IssuePanel.this.workedFieldFocusLost(evt);
- }
- }
- }// //GEN-END:initComponents
-
- private void productComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_productComboActionPerformed
- productChanged(true);
- }//GEN-LAST:event_productComboActionPerformed
-
- private boolean productChanged(boolean reload) {
- cancelHighlight(productLabel);
- // Reload componentCombo, versionCombo and targetMilestoneCombo
- BugzillaRepository repository = issue.getRepository();
- BugzillaConfiguration bc = repository.getConfiguration();
- if (bc == null || !bc.isValid()) {
- // XXX nice error msg?
- return true;
- }
- String product = productCombo.getSelectedItem().toString();
- Object component = componentCombo.getSelectedItem();
- Object version = versionCombo.getSelectedItem();
- Object targetMilestone = targetMilestoneCombo.getSelectedItem();
- componentCombo.setModel(toComboModel(bc.getComponents(product)));
- versionCombo.setModel(toComboModel(bc.getVersions(product)));
- List targetMilestones = bc.getTargetMilestones(product);
- usingTargetMilestones = !targetMilestones.isEmpty();
- targetMilestoneCombo.setModel(toComboModel(targetMilestones));
- // Attempt to keep selection
- if (!selectInCombo(componentCombo, component, false)) {
- if (issue.isNew() && componentCombo.getModel().getSize() > 0
- || componentCombo.getModel().getSize() == 1) {
- componentCombo.setSelectedIndex(0);
- } else {
- componentCombo.setSelectedItem(null);
- }
- storeFieldValueForNewIssue(IssueField.COMPONENT, componentCombo);
- }
- if (!selectInCombo(versionCombo, version, false)) {
- if (issue.isNew() && versionCombo.getModel().getSize() > 0
- || versionCombo.getModel().getSize() == 1) {
- versionCombo.setSelectedIndex(0);
- } else {
- versionCombo.setSelectedItem(null);
- }
- storeFieldValueForNewIssue(IssueField.VERSION, versionCombo);
- }
- if (usingTargetMilestones) {
- if (!selectInCombo(targetMilestoneCombo, targetMilestone, false)) {
- if (issue.isNew() && targetMilestoneCombo.getModel().getSize() > 0
- || targetMilestoneCombo.getModel().getSize() == 1) {
- targetMilestoneCombo.setSelectedIndex(0);
- } else {
- targetMilestoneCombo.setSelectedItem(null);
- }
- storeFieldValueForNewIssue(IssueField.MILESTONE, targetMilestoneCombo);
- }
- }
- targetMilestoneLabel.setVisible(usingTargetMilestones);
- targetMilestoneCombo.setVisible(usingTargetMilestones);
- milestoneWarning.setVisible(usingTargetMilestones);
- if (issue.isNew()) {
- issue.setFieldValue(IssueField.PRODUCT, product);
- if (BugzillaUtil.isNbRepository(repository)) { // IssueProvider 180467, 184412
- // Default target milestone
- List milestones = repository.getConfiguration().getTargetMilestones(product);
- String defaultMilestone = "TBD"; // NOI18N
- if (milestones.contains(defaultMilestone)) {
- issue.setFieldValue(IssueField.MILESTONE, defaultMilestone);
- }
- // Default version
- List versions = repository.getConfiguration().getVersions(product);
- String defaultVersion = getCurrentNetBeansVersion();
- for (String v : versions) {
- if (v.trim().equalsIgnoreCase(defaultVersion)) {
- issue.setFieldValue(IssueField.VERSION, v);
- }
- }
- }
- if(reload) { // But the reloaders, the vile, the murderers ... and all liars—they will be consigned to the fiery lake of burning sulfur. This is the second death.
- if (reloading) {
- // reload when current refresh of components finishes
- EventQueue.invokeLater(new Runnable () {
- @Override
- public void run () {
- reloadForm(false);
- }
- });
- } else {
- reloadForm(false);
- }
- }
- }
- return false;
- }
-
- private void statusComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_statusComboActionPerformed
- cancelHighlight(statusLabel);
- cancelHighlight(resolutionLabel);
- // Hide/show resolution combo
- if ("RESOLVED".equals(statusCombo.getSelectedItem())) { // NOI18N
- if (resolutionCombo.getParent() == null) {
- ((GroupLayout) attributesSectionPanel.getLayout()).replace(resolutionField, resolutionCombo);
- }
- boolean setResolution = !resolutionCombo.isVisible();
- resolutionCombo.setVisible(true);
- resolutionWarning.setVisible(true);
- resolutionLabel.setVisible(true);
- String resolution = issue.getRepositoryFieldValue(IssueField.RESOLUTION);
- if (resolution.isEmpty()) {
- resolution = "FIXED"; //NOI18N
- }
- if (setResolution) {
- resolutionCombo.setSelectedItem(resolution);
- }
- } else {
- resolutionCombo.setVisible(false);
- resolutionLabel.setVisible(false);
- resolutionWarning.setVisible(false);
- updateFieldDecorations(resolutionCombo, IssueField.RESOLUTION, resolutionWarning, resolutionLabel);
- duplicateLabel.setVisible(false);
- duplicateWarning.setVisible(false);
- duplicateField.setVisible(false);
- duplicateButton.setVisible(false);
- updateFieldDecorations(duplicateField, IssueField.DUPLICATE_ID, duplicateWarning, duplicateLabel);
- updateNoDuplicateId();
- }
- if (!resolutionField.getText().trim().equals("")) { // NOI18N
- if (statusCombo.getSelectedIndex() > resolvedIndex) {
- if (resolutionField.getParent() == null) {
- ((GroupLayout) attributesSectionPanel.getLayout()).replace(resolutionCombo, resolutionField);
- }
- resolutionField.setVisible(true);
- } else {
- resolutionField.setVisible(false);
- }
- duplicateLabel.setVisible(false);
- duplicateWarning.setVisible(false);
- duplicateField.setVisible(false);
- duplicateButton.setVisible(false);
- updateFieldDecorations(duplicateField, IssueField.DUPLICATE_ID, duplicateWarning, duplicateLabel);
- updateNoDuplicateId();
- }
- resolutionLabel.setLabelFor(resolutionCombo.isVisible() ? resolutionCombo : resolutionField);
- }//GEN-LAST:event_statusComboActionPerformed
-
- private void storeCCValue() {
- Set oldCCs = ccs(issue.getRepositoryFieldValue(IssueField.CC));
- Set newCCs = ccs(ccField.getText());
-
- String removedCCs = getMissingCCs(oldCCs, newCCs);
- String addedCCs = getMissingCCs(newCCs, oldCCs);
-
- addUnsavedField(IssueField.CC.getKey());
- issue.setFieldValues(IssueField.CC, new ArrayList<>(ccs(ccField.getText())));
- storeFieldValue(IssueField.REMOVECC, removedCCs);
- storeFieldValue(IssueField.NEWCC, addedCCs);
- }
-
- private Set ccs(String values) {
- Set ccs = new LinkedHashSet<>();
- StringTokenizer st = new StringTokenizer(values, ", \t\n\r\f"); // NOI18N
- while (st.hasMoreTokens()) {
- ccs.add(st.nextToken());
- }
- return ccs;
- }
-
- private String getMissingCCs(Set ccs, Set missingIn) {
- StringBuilder ret = new StringBuilder();
- Iterator it = ccs.iterator();
- while(it.hasNext()) {
- String cc = it.next();
- if(cc.trim().equals("")) continue;
- if(!missingIn.contains(cc)) {
- ret.append(cc);
- if(it.hasNext()) {
- ret.append(',');
- }
- }
- }
- return ret.toString();
- }
-
- private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed
- String refreshMessageFormat = NbBundle.getMessage(IssuePanel.class, "IssuePanel.refreshMessage"); // NOI18N
- String refreshMessage = MessageFormat.format(refreshMessageFormat, issue.getID());
- final ProgressHandle handle = ProgressHandleFactory.createHandle(refreshMessage);
- handle.start();
- handle.switchToIndeterminate();
- skipReload = true;
- enableComponents(false);
- RP.post(new Runnable() {
- @Override
- public void run() {
- try {
- issue.updateModelAndRefresh();
- } finally {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- enableComponents(true);
- skipReload = false;
- }
- });
- handle.finish();
- reloadFormInAWT(true);
- }
- }
- });
- }//GEN-LAST:event_refreshButtonActionPerformed
-
- private void resolutionComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_resolutionComboActionPerformed
- cancelHighlight(resolutionLabel);
- if (resolutionCombo.getParent() == null) {
- return;
- }
- boolean shown = "DUPLICATE".equals(resolutionCombo.getSelectedItem()); // NOI18N
- duplicateLabel.setVisible(shown);
- duplicateWarning.setVisible(shown);
- duplicateField.setVisible(shown);
- duplicateButton.setVisible(shown && duplicateField.isEditable());
- updateFieldDecorations(duplicateField, IssueField.DUPLICATE_ID, duplicateWarning, duplicateLabel);
- updateNoDuplicateId();
- }//GEN-LAST:event_resolutionComboActionPerformed
-
- private void keywordsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keywordsButtonActionPerformed
- String message = NbBundle.getMessage(IssuePanel.class, "IssuePanel.keywordsButton.message"); // NOI18N
- String kws = BugzillaUtil.getKeywords(message, keywordsField.getText(), issue.getRepository());
- keywordsField.setText(kws);
- }//GEN-LAST:event_keywordsButtonActionPerformed
-
- private void blocksButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_blocksButtonActionPerformed
- Issue i = IssueQuickSearch.selectIssue(
- NbBundle.getMessage(IssuePanel.class, "IssuePanel.blocksButton.message"), // NOI18N
- BugzillaUtil.getRepository(issue.getRepository()),
- this,
- new HelpCtx("org.netbeans.modules.bugzilla.blocksChooser")); // NOI18N
- if (i != null) {
- String newIssueID = i.getID();
- StringBuilder sb = new StringBuilder();
- if (!blocksField.getText().trim().equals("")) { // NOI18N
- sb.append(blocksField.getText()).append(',').append(' ');
- }
- sb.append(newIssueID);
- blocksField.setText(sb.toString());
- }
- }//GEN-LAST:event_blocksButtonActionPerformed
-
- private void dependsOnButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dependsOnButtonActionPerformed
- Issue i = IssueQuickSearch.selectIssue(
- NbBundle.getMessage(IssuePanel.class, "IssuePanel.dependsOnButton.message"), // NOI18N
- BugzillaUtil.getRepository(issue.getRepository()),
- this,
- new HelpCtx("org.netbeans.modules.bugzilla.dependsOnChooser")); // NOI18N
- if (i != null) {
- String newIssueID = i.getID();
- StringBuilder sb = new StringBuilder();
- if (!dependsField.getText().trim().equals("")) { // NOI18N
- sb.append(dependsField.getText()).append(',').append(' ');
- }
- sb.append(newIssueID);
- dependsField.setText(sb.toString());
- }
- }//GEN-LAST:event_dependsOnButtonActionPerformed
-
- private void componentComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_componentComboActionPerformed
- cancelHighlight(componentLabel);
- updateNoComponent();
- }//GEN-LAST:event_componentComboActionPerformed
-
- private void versionComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_versionComboActionPerformed
- cancelHighlight(versionLabel);
- updateNoVersion();
- }//GEN-LAST:event_versionComboActionPerformed
-
- private void platformComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_platformComboActionPerformed
- cancelHighlight(platformLabel);
- }//GEN-LAST:event_platformComboActionPerformed
-
- private void priorityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_priorityComboActionPerformed
- cancelHighlight(priorityLabel);
- }//GEN-LAST:event_priorityComboActionPerformed
-
- private void severityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_severityComboActionPerformed
- cancelHighlight(priorityLabel);
- }//GEN-LAST:event_severityComboActionPerformed
-
- private void targetMilestoneComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_targetMilestoneComboActionPerformed
- cancelHighlight(targetMilestoneLabel);
- updateNoTargetMilestone();
- }//GEN-LAST:event_targetMilestoneComboActionPerformed
-
- private void osComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_osComboActionPerformed
- cancelHighlight(platformLabel);
- }//GEN-LAST:event_osComboActionPerformed
-
- private void reloadButtonActionPerformed(java.awt.event.ActionEvent evt) {
- String reloadMessage = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reloadMessage"); // NOI18N
- final ProgressHandle handle = ProgressHandleFactory.createHandle(reloadMessage);
- handle.start();
- handle.switchToIndeterminate();
- skipReload = true;
- enableComponents(false);
- RP.post(new Runnable() {
- @Override
- public void run() {
- issue.getRepository().refreshConfiguration();
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- try {
- reloading = true;
- Object product = productCombo.getSelectedItem();
- Object platform = platformCombo.getSelectedItem();
- Object os = osCombo.getSelectedItem();
- Object priority = priorityCombo.getSelectedItem();
- Object severity = severityCombo.getSelectedItem();
- Object resolution = resolutionCombo.getSelectedItem();
- Object issueType = issueTypeCombo.getSelectedItem();
- initCombos();
- initCustomFields();
- selectInCombo(productCombo, product, false);
- productChanged(false);
- selectInCombo(platformCombo, platform, false);
- selectInCombo(osCombo, os, false);
- selectInCombo(priorityCombo, priority, false);
- selectInCombo(severityCombo, severity, false);
- initStatusCombo(statusCombo.getSelectedItem().toString());
- selectInCombo(resolutionCombo, resolution, false);
- if (BugzillaUtil.isNbRepository(issue.getRepository())) {
- issueTypeCombo.setSelectedItem(issueType);
- }
- reloadCustomFields(true);
- updateCustomFieldStatuses();
- } finally {
- reloading = false;
- enableComponents(true);
- skipReload = false;
- }
- }
- });
- handle.finish();
- }
- });
- }
-
- private void duplicateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_duplicateButtonActionPerformed
- Issue i = IssueQuickSearch.selectIssue(
- NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.message"), //NOI18N
- BugzillaUtil.getRepository(issue.getRepository()),
- this,
- new HelpCtx("org.netbeans.modules.bugzilla.duplicateChooser")); // NOI18N
- if (i != null) {
- String newIssueID = i.getID();
- duplicateField.setText(newIssueID);
- }
- }//GEN-LAST:event_duplicateButtonActionPerformed
-
- private void assignedComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_assignedComboActionPerformed
- cancelHighlight(assignedLabel);
- if (!reloading) {
- assignedToStatusLabel.setVisible(false);
- }
- Object value = assignedCombo.getSelectedItem();
- if (value instanceof RepositoryUser) {
- String assignee = ((RepositoryUser)value).getUserName();
- BugzillaRepository repository = issue.getRepository();
- assignedCombo.setSelectedItem(assignee);
- }
- }//GEN-LAST:event_assignedComboActionPerformed
-
- private void issueTypeComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_issueTypeComboActionPerformed
- cancelHighlight(issueTypeLabel);
- }//GEN-LAST:event_issueTypeComboActionPerformed
-
- private void showInBrowserButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_showInBrowserButtonActionPerformed
- try {
- URL url = new URL(issue.getRepository().getUrl() + BugzillaConstants.URL_SHOW_BUG + issue.getID());
- HtmlBrowser.URLDisplayer.getDefault().showURL(url);
- } catch (MalformedURLException muex) {
- Bugzilla.LOG.log(Level.INFO, "Unable to show the issue in the browser.", muex); // NOI18N
- }
- }//GEN-LAST:event_showInBrowserButtonActionPerformed
-
-private void urlButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_urlButtonActionPerformed
- String urlString = urlField.getText();
- if(urlString.isEmpty()) {
- return;
- }
- URL url = null;
- try {
- url = new URL(urlString);
- } catch (MalformedURLException muex) {
- if(issue != null) {
- String repoUrlString = issue.getRepository().getUrl();
- urlString = repoUrlString + (repoUrlString.endsWith("/") ? "" : "/") + urlString; // NOI18N
- try {
- url = new URL(urlString);
- } catch (MalformedURLException ex) {
- Bugzilla.LOG.log(Level.INFO, "Unable to open " + urlString, muex); // NOI18N
- }
- }
- }
- if(url != null) {
- HtmlBrowser.URLDisplayer.getDefault().showURL(url);
- }
-}//GEN-LAST:event_urlButtonActionPerformed
-private void workedFieldFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_workedFieldFocusLost
- if(!"".equals(workedField.getText().trim())) {
- String workedString = workedField.getText().trim();
- if(!workedString.trim().equals("")) {
- try {
- Double.parseDouble(workedString);
- } catch (NumberFormatException e) {
- return;
- }
- }
- double actual = getDoubleValue(actualField);
- double worked = getDoubleValue(workedField);
- double workedSum = getDoubleValue(workedSumField);
-
- double remaining = actual - worked - workedSum;
- if(remaining > 0) {
- remainingField.setText(String.valueOf(remaining));
- } else {
- remainingField.setText("0"); // NOI18N
- }
- }
-}//GEN-LAST:event_workedFieldFocusLost
-
- private void attachLogCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_attachLogCheckBoxActionPerformed
- switchViewLog();
- }//GEN-LAST:event_attachLogCheckBoxActionPerformed
-
- private void viewLogButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_viewLogButtonActionPerformed
- showLogFile(evt);
- }//GEN-LAST:event_viewLogButtonActionPerformed
-
- private void submitButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_submitButtonActionPerformed
- final boolean isNew = issue.isNew();
- if(isNew && reproducibilityCombo.isVisible()) {
- String repro = NbBundle.getMessage(IssuePanel.class, "IssuePanel.reproducibilityCommitText", (String) reproducibilityCombo.getSelectedItem()); // NOI18N
- String comment = addCommentArea.getText();
- String nbInfo = getNetbeansInfo();
- int idx = nbInfo.lastIndexOf("\n"); // NOI18N
- if(idx > 0) {
- String s = nbInfo.substring(idx, nbInfo.length() - 1);
- idx = comment.indexOf(s);
- if(idx > 0) {
- idx += s.length() + 1;
- comment = comment.substring(0, idx) + "\n\n" + repro + comment.substring(idx); // NOI18N
- } else {
- comment = repro + "\n\n" + comment; // NOI18N
- }
- } else {
- comment = repro + "\n\n" + comment; // NOI18N
- }
- issue.setFieldValue(IssueField.DESCRIPTION, comment);
- }
-
- String submitMessage;
- if (isNew) {
- submitMessage = NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitNewMessage"); // NOI18N
- } else {
- String submitMessageFormat = NbBundle.getMessage(IssuePanel.class, "IssuePanel.submitMessage"); // NOI18N
- submitMessage = MessageFormat.format(submitMessageFormat, issue.getID());
- }
- final ProgressHandle handle = ProgressHandleFactory.createHandle(submitMessage);
- handle.start();
- handle.switchToIndeterminate();
- skipReload = true;
- enableComponents(false);
- RP.post(new Runnable() {
- @Override
- public void run() {
- boolean submitOK = false;
- try {
- submitOK = issue.submitAndRefresh();
- } finally {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- enableComponents(true);
- skipReload = false;
- }
- });
- handle.finish();
- if(submitOK) {
- if (isNew) {
- // Show all custom fields, not only the ones shown on bug creation
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- initCustomFields();
- }
- });
- }
- reloadFormInAWT(true);
- }
- }
- }
- });
- }//GEN-LAST:event_submitButtonActionPerformed
-
- boolean saveSynchronously() {
- boolean saved = false;
- try {
- saved = issue.save();
- } finally {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- clearUnsavedFields();
- enableComponents(true);
- updateFieldStatuses();
- cancelButton.setEnabled(issue.hasLocalEdits());
- skipReload = false;
- }
- });
- }
- return saved;
- }
-
- @NbBundle.Messages({
- "LBL_IssuePanel.cancelChanges.title=Cancel Local Edits?",
- "MSG_IssuePanel.cancelChanges.message=Do you want to cancel all your local changes to this task?"
- })
- private void cancelButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cancelButtonActionPerformed
- if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
- Bundle.MSG_IssuePanel_cancelChanges_message(),
- Bundle.LBL_IssuePanel_cancelChanges_title(), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) {
- return;
- }
- discard();
- }
-
- void discard() {
- skipReload = true;
- enableComponents(false);
- RP.post(new Runnable() {
- @Override
- public void run() {
- boolean cleared = false;
- try {
- cleared = issue.discardLocalEdits();
- } finally {
- final boolean fCleared = cleared;
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- clearUnsavedFields();
- enableComponents(true);
- cancelButton.setEnabled(!fCleared);
- skipReload = false;
- reloadForm(true);
- }
- });
- }
- }
- });
- }//GEN-LAST:event_cancelButtonActionPerformed
-
- void clearUnsavedChanges() {
- issue.clearUnsavedChanges();
- clearUnsavedFields();
- }
-
- private void clearUnsavedFields() {
- boolean fire = !unsavedFields.isEmpty();
- unsavedFields.clear();
- if(fire) {
- issue.fireChangeEvent();
- }
- }
-
- private void addUnsavedField(String fieldName) {
- boolean fire = unsavedFields.isEmpty();
- unsavedFields.add(fieldName);
- if(fire) {
- issue.fireChangeEvent();
- }
- }
-
- boolean isChanged() {
- return !initializingNewTask() && getIssue().hasUnsavedChanges();
- }
-
- @NbBundle.Messages({
- "LBL_IssuePanel.deleteTask.title=Delete New Task?",
- "MSG_IssuePanel.deleteTask.message=Do you want to delete the new task permanently?"
- })
- private void btnDeleteTaskActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnDeleteTaskActionPerformed
- if (JOptionPane.YES_OPTION != JOptionPane.showConfirmDialog(WindowManager.getDefault().getMainWindow(),
- Bundle.MSG_IssuePanel_deleteTask_message(),
- Bundle.LBL_IssuePanel_deleteTask_title(), JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE)) {
- return;
- }
- clearUnsavedChanges();
- Container tc = SwingUtilities.getAncestorOfClass(TopComponent.class, this);
- if (tc instanceof TopComponent) {
- ((TopComponent) tc).close();
- }
- RP.post(new Runnable() {
- @Override
- public void run() {
- issue.delete();
- }
- });
- }//GEN-LAST:event_btnDeleteTaskActionPerformed
-
- private void reproducibilityComboActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reproducibilityComboActionPerformed
- updateNoReproducibility();
- }//GEN-LAST:event_reproducibilityComboActionPerformed
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JTextField actualField;
- private javax.swing.JLabel actualLabel;
- private javax.swing.JLabel actualWarning;
- private javax.swing.JTextArea addCommentArea;
- private javax.swing.JCheckBox assignToDefaultCheckBox;
- private javax.swing.JComboBox assignedCombo;
- private javax.swing.JTextField assignedField;
- private javax.swing.JLabel assignedLabel;
- private javax.swing.JLabel assignedToStatusLabel;
- private javax.swing.JLabel assignedToWarning;
- private javax.swing.JCheckBox attachLogCheckBox;
- private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel attachmentsSection;
- private javax.swing.JPanel attachmentsSectionPanel;
- private javax.swing.JLabel attachmentsWarning;
- private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel attributesSection;
- private javax.swing.JPanel attributesSectionPanel;
- private javax.swing.JButton blocksButton;
- private javax.swing.JTextField blocksField;
- private javax.swing.JLabel blocksLabel;
- private javax.swing.JLabel blocksWarning;
- private org.netbeans.modules.bugtracking.commons.LinkButton btnDeleteTask;
- private javax.swing.JPanel buttonsPanel;
- private org.netbeans.modules.bugtracking.commons.LinkButton cancelButton;
- private javax.swing.JTextField ccField;
- private javax.swing.JLabel ccLabel;
- private javax.swing.JLabel ccWarning;
- private javax.swing.JLabel commentWarning;
- private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel commentsSection;
- private javax.swing.JPanel commentsSectionPanel;
- private javax.swing.JTextField completeField;
- private javax.swing.JLabel completeLabel;
- private javax.swing.JLabel completeWarning;
- private javax.swing.JComboBox componentCombo;
- private javax.swing.JLabel componentLabel;
- private javax.swing.JLabel componentWarning;
- private javax.swing.JPanel customFieldsPanelLeft;
- private javax.swing.JPanel customFieldsPanelRight;
- private javax.swing.JLabel deadlineLabel;
- private javax.swing.JLabel deadlineWarning;
- private javax.swing.JTextField dependsField;
- private javax.swing.JLabel dependsLabel;
- private javax.swing.JButton dependsOnButton;
- private javax.swing.JLabel dependsOnWarning;
- private javax.swing.JLabel dueDateLabel;
- private javax.swing.JPanel dummyAttachmentsPanel;
- private javax.swing.JPanel dummyCommentsPanel;
- private javax.swing.JTextField dummyDeadlineField;
- private javax.swing.JTextField dummyDueDateField;
- private javax.swing.JLabel dummyLabel1;
- private javax.swing.JLabel dummyLabel2;
- private javax.swing.JLabel dummyLabel3;
- private javax.swing.JTextField dummyScheduleDateField;
- private javax.swing.JLabel dummyTimetrackingLabel;
- private javax.swing.JPanel dummyTimetrackingPanel;
- private javax.swing.JButton duplicateButton;
- private javax.swing.JTextField duplicateField;
- private javax.swing.JLabel duplicateLabel;
- private javax.swing.JLabel duplicateWarning;
- private javax.swing.JFormattedTextField estimateField;
- private javax.swing.JLabel estimateLabel;
- private javax.swing.JTextField estimatedField;
- private javax.swing.JLabel estimatedLabel;
- private javax.swing.JLabel estimatedWarning;
- private javax.swing.JTextField gainField;
- private javax.swing.JLabel gainLabel;
- private javax.swing.JLabel gainWarning;
- private javax.swing.JTextField headerField;
- private javax.swing.JPanel headerPanel;
- private javax.swing.JComboBox issueTypeCombo;
- private javax.swing.JLabel issueTypeLabel;
- private javax.swing.JLabel issueTypeWarning;
- private javax.swing.JComboBox jComboBox1;
- private javax.swing.JLabel jLabel7;
- private javax.swing.JPanel jPanel1;
- private javax.swing.JButton keywordsButton;
- private javax.swing.JTextField keywordsField;
- private javax.swing.JLabel keywordsLabel;
- private javax.swing.JLabel keywordsWarning;
- private javax.swing.JPanel mainPanel;
- private javax.swing.JScrollPane mainScrollPane;
- private javax.swing.JPanel messagePanel;
- private javax.swing.JLabel milestoneWarning;
- private javax.swing.JTextField modifiedField;
- private javax.swing.JLabel modifiedLabel;
- private org.netbeans.modules.bugtracking.commons.SectionPanel newCommentSection;
- private javax.swing.JPanel newCommentSectionPanel;
- private javax.swing.JLabel notesLabel;
- private javax.swing.JComboBox osCombo;
- private javax.swing.JComboBox platformCombo;
- private javax.swing.JLabel platformLabel;
- private javax.swing.JLabel platformWarning;
- private javax.swing.JComboBox priorityCombo;
- private javax.swing.JLabel priorityLabel;
- private javax.swing.JLabel priorityWarning;
- private javax.swing.JTextArea privateNotesField;
- private javax.swing.JScrollPane privateNotesScrollPane;
- private javax.swing.JPanel privatePanel;
- private org.netbeans.modules.bugtracking.commons.CollapsibleSectionPanel privateSection;
- private javax.swing.JComboBox productCombo;
- private javax.swing.JTextField productField;
- private javax.swing.JLabel productLabel;
- private javax.swing.JLabel productWarning;
- private javax.swing.JTextField qaContactField;
- private javax.swing.JLabel qaContactLabel;
- private javax.swing.JLabel qaContactWarning;
- private org.netbeans.modules.bugtracking.commons.LinkButton refreshButton;
- private javax.swing.JTextField remainingField;
- private javax.swing.JLabel remainingLabel;
- private javax.swing.JLabel remainingWarning;
- private javax.swing.JTextField reportedField;
- private javax.swing.JLabel reportedLabel;
- private javax.swing.JLabel reportedStatusLabel;
- private javax.swing.JComboBox reproducibilityCombo;
- private javax.swing.JLabel reproducibilityLabel;
- private javax.swing.JComboBox resolutionCombo;
- private javax.swing.JTextField resolutionField;
- private javax.swing.JLabel resolutionLabel;
- private javax.swing.JLabel resolutionWarning;
- private javax.swing.JLabel scheduleDateLabel;
- private javax.swing.JScrollPane scrollPane1;
- private javax.swing.JLabel separatorDismissButton;
- private javax.swing.JLabel separatorLabel3;
- private javax.swing.JLabel separatorLabel4;
- private javax.swing.JLabel separatorLabel6;
- private javax.swing.JComboBox severityCombo;
- private org.netbeans.modules.bugtracking.commons.LinkButton showInBrowserButton;
- private javax.swing.JComboBox statusCombo;
- private javax.swing.JLabel statusLabel;
- private javax.swing.JLabel statusWarning;
- private javax.swing.JTextField statusWhiteboardField;
- private javax.swing.JLabel statusWhiteboardLabel;
- private javax.swing.JLabel statusWhiteboardWarning;
- private org.netbeans.modules.bugtracking.commons.LinkButton submitButton;
- private javax.swing.JTextField summaryField;
- private javax.swing.JLabel summaryLabel;
- private javax.swing.JLabel summaryWarning;
- private javax.swing.JComboBox targetMilestoneCombo;
- private javax.swing.JLabel targetMilestoneLabel;
- private javax.swing.JLabel timetrackingLabel;
- private javax.swing.JPanel timetrackingPanel;
- private javax.swing.JLabel timetrackingWarning;
- private javax.swing.JTextField urlField;
- private org.netbeans.modules.bugtracking.commons.LinkButton urlLabel;
- private javax.swing.JLabel urlWarning;
- private javax.swing.JComboBox versionCombo;
- private javax.swing.JLabel versionLabel;
- private javax.swing.JLabel versionWarning;
- private org.netbeans.modules.bugtracking.commons.LinkButton viewLogButton;
- private javax.swing.JTextField workedField;
- private javax.swing.JLabel workedLabel;
- private javax.swing.JLabel workedSumField;
- private javax.swing.JLabel workedWarning;
- // End of variables declaration//GEN-END:variables
-
- void makeCaretVisible(JTextArea textArea) {
- int pos = textArea.getCaretPosition();
- try {
- Rectangle rec = textArea.getUI().modelToView(textArea, pos);
- if (rec != null) {
- Point p = SwingUtilities.convertPoint(textArea, rec.x, rec.y, this);
- scrollRectToVisible(new Rectangle(p.x, p.y, rec.width, rec.height));
- }
- } catch (BadLocationException blex) {
- Bugzilla.LOG.log(Level.INFO, blex.getMessage(), blex);
- }
- }
-
- private static final String CURRENT_NB_VERSION = "8.1"; // NOI18N
- private String getCurrentNetBeansVersion() {
- String version = parseProductVersion(getProductVersionValue());
- if(version != null) {
- if(version.equalsIgnoreCase("dev")) { // NOI18N
- return CURRENT_NB_VERSION;
- } else {
- return version;
- }
- }
- return CURRENT_NB_VERSION;
- }
-
- static String parseProductVersion(String productVersionValue) {
- Pattern p = Pattern.compile("NetBeans IDE\\s([a-zA-Z0-9\\.?]*)\\s?.*"); // NOI18N
- Matcher m = p.matcher(productVersionValue);
- if(m.matches()) {
- String version = m.group(1);
- if(version != null && !version.trim().isEmpty()) {
- return version;
- }
- }
- return null;
- }
-
- private void addNetbeansInfo() {
- assert issue.isNew();
- String infoTxt = getNetbeansInfo();
- addCommentArea.setText(infoTxt + "\n\n" + NbBundle.getMessage(IssuePanel.class, "IssuePanel.newIssue.netbeansDescTemplate")); // NOI18N
- storeFieldValueForNewIssue(IssueField.DESCRIPTION, addCommentArea);
- }
-
- private String getNetbeansInfo() throws MissingResourceException {
- String format = NbBundle.getMessage(IssuePanel.class, "IssuePanel.newIssue.netbeansInfo"); // NOI18N
- Object[] info = new Object[] {
- getProductVersionValue(),
- System.getProperty("os.name", "unknown"), // NOI18N
- System.getProperty("os.version", "unknown"), // NOI18N
- System.getProperty("os.arch", "unknown"), // NOI18N
- System.getProperty("java.version", "unknown"), // NOI18N
- System.getProperty("java.vm.name", "unknown"), // NOI18N
- System.getProperty("java.vm.version", "") // NOI18N
- };
- return MessageFormat.format(format, info);
- }
-
- public static String getProductVersionValue () {
- return MessageFormat.format(
- NbBundle.getBundle("org.netbeans.core.startup.Bundle").getString("currentVersion"), // NOI18N
- new Object[] {System.getProperty("netbeans.buildnumber")}); // NOI18N
- }
-
- void opened() {
- restoreSections();
- enableComponents(false);
- issue.opened();
- opened = true;
- }
-
- void closed() {
- if(issue != null) {
- persistSections();
- commentsPanel.storeSettings();
- opened = false;
- issue.closed();
- }
- }
-
- private void persistSections () {
- if (!issue.isNew()) {
- BugzillaConfig config = BugzillaConfig.getInstance();
- String repositoryId = issue.getRepository().getID();
- String taskId = issue.getID();
- config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTRIBUTES, !attributesSection.isExpanded());
- config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTACHMENTS, !attachmentsSection.isExpanded());
- config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_COMMENTS, !commentsSection.isExpanded());
- config.setEditorSectionCollapsed(repositoryId, taskId, SECTION_PRIVATE, !privateSection.isExpanded());
- }
- }
-
- private void restoreSections () {
- BugzillaConfig config = BugzillaConfig.getInstance();
- String repositoryId = issue.getRepository().getID();
- String taskId = issue.getID();
- attributesSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTRIBUTES, false));
- attachmentsSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_ATTACHMENTS, true));
- commentsSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_COMMENTS, false));
- privateSection.setExpanded(!config.isEditorSectionCollapsed(repositoryId, taskId, SECTION_PRIVATE, true));
- }
-
- private double getDoubleValue(JComponent field) {
- assert field instanceof JTextField || field instanceof JLabel;
-
- String txt;
- if(field instanceof JTextField) {
- txt = ((JTextField)field).getText();
- } else {
- txt = ((JLabel)field).getText();
- }
- if(txt.isEmpty()) return 0;
- try {
- return Double.parseDouble(txt);
- } catch (NumberFormatException e) {
- Bugzilla.LOG.log(Level.WARNING, txt, e);
- return 0;
- }
- }
-
- static void showLogFile(ActionEvent evt) {
- Action a = getShowLogAction();
- if(a != null) {
- a.actionPerformed(null);
- }
- }
-
- static Action getShowLogAction() {
- return FileUtil.getConfigObject("Actions/View/org-netbeans-core-actions-LogAction.instance", Action.class); // NOI18N
- }
-
- private void switchViewLog() {
- viewLogButton.setVisible(attachLogCheckBox.isSelected());
- }
-
- private String mergeValues (List values) {
- String newValue;
- StringBuilder sb = new StringBuilder();
- for (String value : values) {
- if (sb.length()!=0) {
- sb.append(',');
- }
- sb.append(value);
- }
- newValue = sb.toString();
- return newValue;
- }
-
- private void setupListeners () {
- if (issue.isNew()) {
- addCommentArea.getDocument().addDocumentListener(new FieldChangeListener(addCommentArea, IssueField.DESCRIPTION) {
- @Override
- void fieldModified () {
- // still new?
- if (issue.isNew()) {
- super.fieldModified();
- }
- }
- });
- }
- addCommentArea.getDocument().addDocumentListener(new FieldChangeListener(addCommentArea, IssueField.COMMENT,
- commentWarning, newCommentSection.getLabelComponent()) {
- @Override
- void fieldModified () {
- if (!(reloading || issue.isNew())) {
- issue.setFieldValue(IssueField.COMMENT, addCommentArea.getText().trim());
- addUnsavedField(IssueField.COMMENT.getKey());
- updateDecorations();
- }
- }
- });
- summaryField.getDocument().addDocumentListener(new FieldChangeListener(summaryField, IssueField.SUMMARY, summaryWarning, summaryLabel));
- productCombo.addActionListener(new FieldChangeListener(productCombo, IssueField.PRODUCT, productWarning, productLabel));
- componentCombo.addActionListener(new FieldChangeListener(componentCombo, IssueField.COMPONENT, componentWarning, componentLabel));
- versionCombo.addActionListener(new FieldChangeListener(versionCombo, IssueField.VERSION, versionWarning, versionLabel));
- platformCombo.addActionListener(new FieldChangeListener(platformCombo, IssueField.PLATFORM, platformWarning, platformLabel, new Pair[] {
- Pair.of(IssueField.PLATFORM, platformCombo),
- Pair.of(IssueField.OS, osCombo)
- }));
- osCombo.addActionListener(new FieldChangeListener(osCombo, IssueField.OS, platformWarning, platformLabel, new Pair[] {
- Pair.of(IssueField.PLATFORM, platformCombo),
- Pair.of(IssueField.OS, osCombo)
- }));
- statusCombo.addActionListener(new FieldChangeListener(statusCombo, IssueField.STATUS, statusWarning, statusLabel));
-
- resolutionCombo.addActionListener(new FieldChangeListener(resolutionCombo, IssueField.RESOLUTION, resolutionWarning, resolutionLabel));
- duplicateField.getDocument().addDocumentListener(new FieldChangeListener(duplicateField, IssueField.DUPLICATE_ID,
- duplicateWarning, duplicateLabel, Bundle.LBL_Duplicate_fieldName()) {
- @Override
- public void fieldModified () {
- if (!reloading && duplicateField.isVisible() && duplicateField.isEditable()) {
- storeFieldValue(IssueField.DUPLICATE_ID, duplicateField); //NOI18N
- updateDecorations();
- }
- }
- });
-
- boolean showIssueType = BugzillaUtil.showIssueType(issue.getRepository());
- priorityCombo.addActionListener(new FieldChangeListener(priorityCombo, IssueField.PRIORITY, priorityWarning, priorityLabel, new Pair[] {
- Pair.of(IssueField.PRIORITY, priorityCombo),
- showIssueType ? Pair.of(IssueField.ISSUE_TYPE, issueTypeCombo) : Pair.of(IssueField.SEVERITY, severityCombo)
- }));
- issueTypeCombo.addActionListener(new FieldChangeListener(issueTypeCombo, IssueField.ISSUE_TYPE, priorityWarning, priorityLabel, new Pair[] {
- Pair.of(IssueField.PRIORITY, priorityCombo),
- Pair.of(IssueField.ISSUE_TYPE, issueTypeCombo)
- }));
- severityCombo.addActionListener(new FieldChangeListener(severityCombo, IssueField.SEVERITY, priorityWarning, priorityLabel, new Pair[] {
- Pair.of(IssueField.PRIORITY, priorityCombo),
- Pair.of(IssueField.SEVERITY, severityCombo)
- }));
- targetMilestoneCombo.addActionListener(new FieldChangeListener(targetMilestoneCombo, IssueField.MILESTONE, milestoneWarning, targetMilestoneLabel));
- assignToDefaultCheckBox.addActionListener(new FieldChangeListener(assignToDefaultCheckBox, IssueField.REASSIGN_TO_DEFAULT));
- urlField.getDocument().addDocumentListener(new FieldChangeListener(urlField, IssueField.URL, urlWarning, urlLabel));
- statusWhiteboardField.getDocument().addDocumentListener(new FieldChangeListener(statusWhiteboardField, IssueField.WHITEBOARD, statusWhiteboardWarning, statusWhiteboardLabel));
- keywordsField.getDocument().addDocumentListener(new FieldChangeListener(keywordsField, IssueField.KEYWORDS, keywordsWarning, keywordsLabel));
- qaContactField.getDocument().addDocumentListener(new FieldChangeListener(qaContactField, IssueField.QA_CONTACT, qaContactWarning, qaContactLabel));
- ccField.getDocument().addDocumentListener(new FieldChangeListener(ccField, IssueField.CC, ccWarning, ccLabel) {
- @Override
- public void fieldModified () {
- if (!reloading) {
- storeCCValue();
- updateDecorations();
- }
- }
- });
- dependsField.getDocument().addDocumentListener(new FieldChangeListener(dependsField, IssueField.DEPENDS_ON, dependsOnWarning, dependsLabel));
- blocksField.getDocument().addDocumentListener(new FieldChangeListener(blocksField, IssueField.BLOCKS, blocksWarning, blocksLabel));
- assignedField.getDocument().addDocumentListener(new FieldChangeListener(assignedField, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel));
- assignedCombo.addActionListener(new FieldChangeListener(assignedCombo, IssueField.ASSIGNED_TO, assignedToWarning, assignedLabel));
-
- estimatedField.getDocument().addDocumentListener(new FieldChangeListener(estimatedField, IssueField.ESTIMATED_TIME, timetrackingWarning, estimatedLabel));
- workedField.getDocument().addDocumentListener(new FieldChangeListener(workedField, IssueField.WORK_TIME, timetrackingWarning, workedLabel));
- remainingField.getDocument().addDocumentListener(new FieldChangeListener(remainingField, IssueField.REMAINING_TIME, timetrackingWarning, remainingLabel));
- deadlinePicker.addChangeListener(new FieldChangeListener(deadlinePicker.getComponent(),
- IssueField.DEADLINE, timetrackingWarning, deadlineLabel, Pair.of(IssueField.DEADLINE, deadlinePicker)) {
-
- @Override
- void fieldModified () {
- if (!reloading && isEnabled()) {
- Date date = deadlinePicker.getDate();
- String value = date == null ? "" : BugzillaIssue.DUE_DATE_FORMAT.format(date);
- if (!issue.getFieldValue(IssueField.DEADLINE).equals(value)) {
- addUnsavedField(IssueField.DEADLINE.getKey());
- issue.setFieldValue(IssueField.DEADLINE, value);
- updateDecorations();
- }
- }
- }
-
- });
- attachLogCheckBox.addActionListener(new FieldChangeListener(attachLogCheckBox, IssueField.NB_ATTACH_IDE_LOG) {
- @Override
- void fieldModified () {
- if (!reloading && isEnabled() && issue.isNew()) {
- boolean selected = ((JCheckBox) attachLogCheckBox).isSelected();
- storeFieldValue(IssueField.NB_ATTACH_IDE_LOG, selected ? "1" : "");
- BugzillaConfig.getInstance().putAttachLogFile(selected);
- }
- }
- });
- attachmentsPanel.addChangeListener(new ChangeListener() {
- @Override
- public void stateChanged (ChangeEvent e) {
- if (!reloading && attachmentsPanel.isVisible()) {
- if (issue.setUnsubmittedAttachments(attachmentsPanel.getNewAttachments())) {
- addUnsavedField(IssueField.NB_NEW_ATTACHMENTS.getKey());
- updateAttachmentsStatus();
- }
- }
- }
- });
- privateNotesField.getDocument().addDocumentListener(new TaskAttributeListener(privateNotesField, ATTRIBUTE_PRIVATE_NOTES, notesLabel) {
-
- @Override
- protected boolean storeValue () {
- String txt = privateNotesField.getText();
- issue.setTaskPrivateNotes(txt);
- setPrivateSectionLabel(txt);
- return true;
- }
- });
- dueDatePicker.addChangeListener(new DatePickerListener(dueDatePicker.getComponent(),
- ATTRIBUTE_DUE_DATE, dueDateLabel) {
-
- @Override
- protected boolean storeValue () {
- issue.setTaskDueDate(dueDatePicker.getDate(), false);
- return true;
- }
- });
- scheduleDatePicker.addChangeListener(new DatePickerListener(scheduleDatePicker.getComponent(),
- ATTRIBUTE_SCHEDULE_DATE, scheduleDateLabel) {
-
- @Override
- protected boolean storeValue () {
- issue.setTaskScheduleDate(scheduleDatePicker.getScheduleDate(), false);
- return true;
- }
- });
- estimateField.getDocument().addDocumentListener(new TaskAttributeListener(estimateField,
- ATTRIBUTE_ESTIMATE, estimateLabel) {
-
- @Override
- protected boolean storeValue () {
- int value = ((Number) estimateField.getValue()).intValue();
- if (value != issue.getEstimate()) {
- issue.setTaskEstimate(value, false);
- return true;
- } else {
- return false;
- }
- }
-
- });
- }
-
- private void setupCustomFieldsListeners () {
- // custom fields
- for (CustomFieldInfo field : customFields) {
- if (field.comp instanceof JTextComponent) {
- ((JTextComponent) field.comp).getDocument().addDocumentListener(
- new FieldChangeListener(field.comp, field.field, field.warning, field.label));
- } else if (field.comp instanceof JComboBox) {
- ((JComboBox) field.comp).addActionListener(
- new FieldChangeListener(field.comp, field.field, field.warning, field.label));
- } else if (field.comp instanceof JList) {
- ((JList) field.comp).addListSelectionListener(
- new FieldChangeListener(field.comp, field.field, field.warning, field.label));
- } else {
- Bugzilla.LOG.log(Level.INFO, "Custom field component {0} is not supported!", field.comp); // NOI18N
- }
- }
- }
-
- @NbBundle.Messages("IssuePanel.reloadButton.text=Reload Attributes")
- private Action[] getAttributesSectionActions () {
- if (attributesSectionActions == null) {
- attributesSectionActions = new Action[] {
- new AbstractAction(Bundle.IssuePanel_reloadButton_text()) {
-
- @Override
- public void actionPerformed (ActionEvent e) {
- reloadButtonActionPerformed(e);
- }
- }
- };
- }
- return attributesSectionActions;
- }
-
- @NbBundle.Messages({
- "IssuePanel.commentsSectionAction.collapse.text=Collapse All",
- "IssuePanel.commentsSectionAction.expand.text=Expand All"
- })
- private Action[] getCommentsSectionActions () {
- if (commentsSectionActions == null) {
- commentsSectionActions = new Action[] {
- new AbstractAction(Bundle.IssuePanel_commentsSectionAction_collapse_text()) {
-
- @Override
- public void actionPerformed (ActionEvent e) {
- commentsPanel.collapseAll();
- commentsSection.setExpanded(false);
- }
- },
- new AbstractAction(Bundle.IssuePanel_commentsSectionAction_expand_text()) {
-
- @Override
- public void actionPerformed (ActionEvent e) {
- commentsPanel.expandAll();
- commentsSection.setExpanded(true);
- }
- }
- };
- }
- return commentsSectionActions;
- }
-
- @NbBundle.Messages({
- "CTL_Attachment.action.create=Add Attachment",
- "CTL_Attachment.action.attachLog=Attach Log"
- })
- private Action[] getAttachmentsSectionActions () {
- if (attachmentsSectionActions == null) {
- List actions = new ArrayList<>();
- actions.add(new AbstractAction(Bundle.CTL_Attachment_action_create()) {
-
- @Override
- public void actionPerformed (ActionEvent e) {
- attachmentsSection.setExpanded(true);
- EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run () {
- attachmentsPanel.createAttachment();
- }
- });
- }
- });
- if (NBBugzillaUtils.isNbRepository(issue.getRepository().getUrl())) {
- actions.add(new AbstractAction(Bundle.CTL_Attachment_action_attachLog()) {
-
- @Override
- public void actionPerformed (ActionEvent e) {
- attachmentsSection.setExpanded(true);
- EventQueue.invokeLater(new Runnable() {
-
- @Override
- public void run () {
- attachmentsPanel.createNbLogAttachment();
- }
- });
- }
- });
- }
- attachmentsSectionActions = actions.toArray(new Action[0]);
- }
- return attachmentsSectionActions;
- }
-
- @NbBundle.Messages("IssuePanel.addToCategory.text=Add to Category")
- private Action[] getPrivateSectionActions () {
- if (privateSectionActions == null) {
- privateSectionActions = new Action[] {
- new AbstractAction(Bundle.IssuePanel_addToCategory_text()) {
- @Override
- public void actionPerformed (ActionEvent e) {
- Bugzilla.getInstance().getBugtrackingFactory().addToCategory(issue.getRepository(), issue);
- }
- }
- };
- }
- return privateSectionActions;
- }
-
- private void storeFieldValueForNewIssue (IssueField f, JComponent component) {
- if (reloading && initializingNewTask) {
- if (component instanceof JTextComponent) {
- issue.setFieldValue(f, ((JTextComponent) component).getText());
- } else if (component instanceof JComboBox) {
- Object value = ((JComboBox) component).getSelectedItem();
- issue.setFieldValue(f, value == null ? "" : value.toString());
- }
- }
- }
-
- private void clearHighlights () {
- fieldsConflict.clear();
- fieldsIncoming.clear();
- fieldsLocal.clear();
- }
-
- private void updateIcon (JLabel label) {
- label.setToolTipText(null);
- label.setIcon(null);
- Map conflicts = tooltipsConflict.get(label);
- Map local = tooltipsLocal.get(label);
- Map remote = tooltipsIncoming.get(label);
- if (conflicts != null || local != null || remote != null) {
- if (conflicts != null) {
- label.setIcon(ICON_CONFLICT);
- } else if (local != null) {
- label.setIcon(ICON_UNSUBMITTED);
- } else {
- label.setIcon(ICON_REMOTE);
- }
- StringBuilder sb = new StringBuilder(""); //NOI18N
- appendTooltips(sb, conflicts);
- appendTooltips(sb, local);
- appendTooltips(sb, remote);
- sb.append(""); //NOI18N
- label.setToolTipText(sb.toString());
- }
- }
-
- private void appendTooltips (StringBuilder sb, Map tooltips) {
- if (tooltips != null) {
- for (Map.Entry e : tooltips.entrySet()) {
- sb.append(e.getValue());
- }
- }
- }
-
- private void removeTooltips (JLabel label, IssueField field) {
- tooltipsConflict.removeTooltip(label, field);
- tooltipsIncoming.removeTooltip(label, field);
- tooltipsLocal.removeTooltip(label, field);
- }
-
- private void initializeNewTask () {
- initializingNewTask = true;
- if(BugzillaUtil.isNbRepository(issue.getRepository())) {
- addNetbeansInfo();
- issue.setFieldValue(IssueField.NB_ATTACH_IDE_LOG, attachLogCheckBox.isSelected() ? "1" : "0");
- }
- // Preselect the first product
- selectProduct();
- initializingNewTask = false;
- }
-
- private static class TooltipsMap extends HashMap> {
-
- private void removeTooltip (JLabel label, IssueField field) {
- Map fields = get(label);
- if (fields != null) {
- fields.remove(field);
- if (fields.isEmpty()) {
- remove(label);
- }
- }
- }
-
- private void addTooltip (JLabel label, IssueField field, String tooltip) {
- Map fields = get(label);
- if (fields == null) {
- fields = new LinkedHashMap<>(2);
- put(label, fields);
- }
- fields.put(field, tooltip);
- }
-
- }
-
- private class FieldChangeListener implements DocumentListener, ActionListener,
- ListSelectionListener, ChangeListener {
- private final IssueField field;
- private final JComponent component;
- private final JLabel warningLabel;
- private final JComponent fieldLabel;
- private final String fieldName;
- private Pair[] decoratedFields;
-
- public FieldChangeListener (JComponent component, IssueField field) {
- this(component, field, null, null);
- }
-
- public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel,
- JComponent fieldLabel) {
- this(component, field, warningLabel, fieldLabel, Pair.of(field, component));
- }
-
- public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel,
- JComponent fieldLabel, String fieldName) {
- this(component, field, warningLabel, fieldLabel, fieldName, Pair.of(field, component));
- }
-
- public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel,
- JComponent fieldLabel, Pair... multiField) {
- this(component, field, warningLabel, fieldLabel,
- fieldLabel == null ? null : fieldName(fieldLabel), multiField);
- }
-
- public FieldChangeListener (JComponent component, IssueField field, JLabel warningLabel,
- JComponent fieldLabel, String fieldName, Pair... multiField) {
- this.component = component;
- this.field = field;
- this.warningLabel = warningLabel;
- this.fieldLabel = fieldLabel;
- this.fieldName = fieldName;
- this.decoratedFields = multiField;
- }
-
- @Override
- public final void insertUpdate (DocumentEvent e) {
- fieldModified();
- }
-
- @Override
- public final void removeUpdate (DocumentEvent e) {
- fieldModified();
- }
-
- @Override
- public final void changedUpdate (DocumentEvent e) {
- fieldModified();
- }
-
- @Override
- public void actionPerformed (ActionEvent e) {
- if (e.getSource() == component) {
- fieldModified();
- }
- }
-
- @Override
- public void valueChanged (ListSelectionEvent e) {
- if (!e.getValueIsAdjusting() && e.getSource() == component) {
- fieldModified();
- }
- }
-
- @Override
- public void stateChanged (ChangeEvent e) {
- fieldModified();
- }
-
- void fieldModified () {
- if (!reloading && isEnabled()) {
- if (component instanceof JTextComponent) {
- storeFieldValue(field, (JTextComponent) component);
- updateDecorations();
- } else if (component instanceof JList) {
- storeFieldValue(field, (JList) component);
- updateDecorations();
- } else if (component instanceof JComboBox) {
- Object value = ((JComboBox) component).getSelectedItem();
- if (value != null && assignToDefaultCheckBox.isVisible() && !assignToDefaultCheckBox.isSelected()) {
- // when changing component or product, assign to default should be automatically selected
- // as it is in browser
- if (component == productCombo && !value.equals(issue.getFieldValue(IssueField.PRODUCT))) {
- assignToDefaultCheckBox.doClick();
- } else if (component == componentCombo && !value.equals(issue.getFieldValue(IssueField.COMPONENT))) {
- assignToDefaultCheckBox.doClick();
- }
- }
- storeFieldValue(field, (JComboBox) component);
- updateDecorations();
- } else if (component instanceof JCheckBox) {
- storeFieldValue(field, ((JCheckBox) component).isSelected() ? "1" : "0");
- updateDecorations();
- }
- }
- }
-
- public boolean isEnabled () {
- return component.isVisible() && component.isEnabled();
- }
-
- protected final void updateDecorations () {
- updateFieldDecorations(warningLabel, fieldLabel, fieldName, decoratedFields);
- }
- }
-
- private abstract class TaskAttributeListener implements DocumentListener {
-
- private final String attributeName;
- private final JComponent component;
- private final JComponent fieldLabel;
-
- public TaskAttributeListener (JComponent component, String attributeName, JComponent fieldLabel) {
- this.component = component;
- this.attributeName = attributeName;
- this.fieldLabel = fieldLabel;
- }
-
- @Override
- public final void insertUpdate (DocumentEvent e) {
- fieldModified();
- }
-
- @Override
- public final void removeUpdate (DocumentEvent e) {
- fieldModified();
- }
-
- @Override
- public final void changedUpdate (DocumentEvent e) {
- fieldModified();
- }
-
- void fieldModified () {
- if (!reloading && isEnabled() && storeValue()) {
- addUnsavedField(attributeName);
- updateDecorations();
- }
- }
-
- public boolean isEnabled () {
- return component.isVisible() && component.isEnabled();
- }
-
- protected final void updateDecorations () {
- updateFieldDecorations(attributeName, fieldLabel);
- }
-
- protected abstract boolean storeValue ();
- }
-
- private abstract class DatePickerListener implements ChangeListener {
-
- private final String attributeName;
- private final JComponent component;
- private final JComponent fieldLabel;
-
- public DatePickerListener (JComponent component,
- String attributeName, JComponent fieldLabel) {
- this.component = component;
- this.attributeName = attributeName;
- this.fieldLabel = fieldLabel;
- }
-
- void fieldModified () {
- if (!reloading && isEnabled() && storeValue()) {
- addUnsavedField(attributeName);
- updateDecorations();
- }
- }
-
- @Override
- public void stateChanged (ChangeEvent e) {
- fieldModified();
- }
-
- public boolean isEnabled () {
- return component.isVisible() && component.isEnabled();
- }
-
- protected final void updateDecorations () {
- updateFieldDecorations(attributeName, fieldLabel);
- }
-
- protected abstract boolean storeValue ();
- }
-
- class CancelHighlightDocumentListener implements DocumentListener {
- private final JComponent label;
-
- CancelHighlightDocumentListener(JComponent label) {
- this.label = label;
- }
-
- @Override
- public void insertUpdate(DocumentEvent e) {
- cancelHighlight(label);
- }
-
- @Override
- public void removeUpdate(DocumentEvent e) {
- cancelHighlight(label);
- }
-
- @Override
- public void changedUpdate(DocumentEvent e) {
- cancelHighlight(label);
- }
- }
-
- class CyclicDependencyDocumentListener implements DocumentListener {
-
- @Override
- public void insertUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void removeUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void changedUpdate(DocumentEvent e) {
- Set bugs1 = bugs(blocksField.getText());
- Set bugs2 = bugs(dependsField.getText());
- bugs1.retainAll(bugs2);
- if (bugs1.isEmpty()) {
- if (cyclicDependency) {
- cyclicDependency = false;
- updateMessagePanel();
- }
- } else {
- if (!cyclicDependency) {
- cyclicDependency = true;
- updateMessagePanel();
- }
- }
- }
-
- private Set bugs(String values) {
- Set bugs = new HashSet<>();
- StringTokenizer st = new StringTokenizer(values, ", \t\n\r\f"); // NOI18N
- while (st.hasMoreTokens()) {
- String token = st.nextToken();
- try {
- bugs.add(Integer.parseInt(token));
- } catch (NumberFormatException nfex) {}
- }
- return bugs;
- }
- }
-
- class RevalidatingListener implements DocumentListener, Runnable {
- private boolean ignoreUpdate;
-
- @Override
- public void insertUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void removeUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void changedUpdate(DocumentEvent e) {
- if (ignoreUpdate) return;
- ignoreUpdate = true;
- EventQueue.invokeLater(this);
- }
-
- @Override
- public void run() {
- revalidate();
- repaint();
- ignoreUpdate = false;
- }
-
- }
-
- private class DuplicateListener implements DocumentListener {
- @Override
- public void insertUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void removeUpdate(DocumentEvent e) {
- changedUpdate(e);
- }
-
- @Override
- public void changedUpdate(DocumentEvent e) {
- updateNoDuplicateId();
- }
- }
-
- private void updateNoDuplicateId() {
- boolean newNoDuplicateId = "DUPLICATE".equals(resolutionCombo.getSelectedItem())
- && duplicateField.isVisible()
- && "".equals(duplicateField.getText().trim());
- if(newNoDuplicateId != noDuplicateId) {
- noDuplicateId = newNoDuplicateId;
- updateMessagePanel();
- }
- }
-
- private static class CustomFieldInfo {
- CustomIssueField field;
- JLabel label;
- JComponent comp;
- JLabel warning;
-
- CustomFieldInfo(CustomIssueField field, JLabel label, JComponent comp, JLabel warning) {
- this.field = field;
- this.label = label;
- this.comp = comp;
- this.warning = warning;
- }
- }
-
- private static class PriorityRenderer extends DefaultListCellRenderer {
-
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- renderer.setIcon(BugzillaConfig.getInstance().getPriorityIcon((String)value));
- return renderer;
- }
-
- }
-}
\ No newline at end of file
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form
deleted file mode 100644
index 37006f63cd59..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.form
+++ /dev/null
@@ -1,195 +0,0 @@
-
-
-
-
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java
deleted file mode 100644
index 4311b3c82988..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/issue/ResolveIssuePanel.java
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.netbeans.modules.bugzilla.issue;
-
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.util.LinkedList;
-import java.util.List;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JButton;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import org.netbeans.modules.bugtracking.api.Issue;
-import org.netbeans.modules.bugtracking.api.IssueQuickSearch;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.openide.DialogDescriptor;
-import org.openide.DialogDisplayer;
-import org.openide.util.HelpCtx;
-import org.openide.util.NbBundle;
-
-/**
- *
- * @author Jan Stola
- */
-public class ResolveIssuePanel extends javax.swing.JPanel {
- private final BugzillaIssue issue;
- private JButton ok = new JButton();
-
- public ResolveIssuePanel(BugzillaIssue issue) {
- this.issue = issue;
- initComponents();
- // workaround for 0 size container gap caused by invisible duplicatePanel
- ((javax.swing.GroupLayout)getLayout()).setHonorsVisibility(false);
-
- BugzillaRepository repository = issue.getRepository();
- BugzillaConfiguration bc = repository.getConfiguration();
- if(bc == null || !bc.isValid()) {
- // XXX nice error msg?
- return;
- }
- List resolutions = new LinkedList(bc.getResolutions());
- resolutions.remove("MOVED"); // NOI18N
- duplicatePanel.setVisible(false);
- resolutionCombo.setModel(new DefaultComboBoxModel(resolutions.toArray()));
- org.openide.awt.Mnemonics.setLocalizedText(ok, NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.resolveButton")); // NOI18N
- }
-
- public String getSelectedResolution() {
- return (String) resolutionCombo.getSelectedItem();
- }
-
- public String getComment() {
- return textArea.getText();
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // //GEN-BEGIN:initComponents
- private void initComponents() {
-
- resolutionLabel = new javax.swing.JLabel();
- resolutionCombo = new javax.swing.JComboBox();
- commentLabel = new javax.swing.JLabel();
- scrollPane = new javax.swing.JScrollPane();
- textArea = new javax.swing.JTextArea();
- duplicatePanel = new javax.swing.JPanel();
- duplicateLabel = new javax.swing.JLabel();
- duplicateField = new javax.swing.JTextField();
- duplicateButton = new javax.swing.JButton();
-
- resolutionLabel.setLabelFor(resolutionCombo);
- org.openide.awt.Mnemonics.setLocalizedText(resolutionLabel, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.resolutionLabel.text")); // NOI18N
-
- commentLabel.setLabelFor(textArea);
- org.openide.awt.Mnemonics.setLocalizedText(commentLabel, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.commentLabel.text")); // NOI18N
-
- textArea.setColumns(80);
- textArea.setRows(5);
- scrollPane.setViewportView(textArea);
- textArea.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.textArea.AccessibleContext.accessibleDescription")); // NOI18N
-
- duplicateLabel.setLabelFor(duplicateField);
- org.openide.awt.Mnemonics.setLocalizedText(duplicateLabel, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateLabel.text")); // NOI18N
-
- duplicateField.setColumns(15);
-
- org.openide.awt.Mnemonics.setLocalizedText(duplicateButton, org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateButton.text")); // NOI18N
- duplicateButton.setFocusPainted(false);
- duplicateButton.setMargin(new java.awt.Insets(0, 0, 0, 0));
- duplicateButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- duplicateButtonActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout duplicatePanelLayout = new javax.swing.GroupLayout(duplicatePanel);
- duplicatePanel.setLayout(duplicatePanelLayout);
- duplicatePanelLayout.setHorizontalGroup(
- duplicatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(duplicatePanelLayout.createSequentialGroup()
- .addComponent(duplicateLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, 151, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(duplicateButton))
- );
- duplicatePanelLayout.setVerticalGroup(
- duplicatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(duplicatePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(duplicateLabel)
- .addComponent(duplicateButton)
- .addComponent(duplicateField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
-
- duplicateField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateField.AccessibleContext.accessibleDescription")); // NOI18N
- duplicateButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.duplicateButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(resolutionLabel)
- .addComponent(commentLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(resolutionCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(duplicatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(scrollPane))
- .addContainerGap())
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addContainerGap()
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(resolutionLabel)
- .addComponent(resolutionCombo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addComponent(duplicatePanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(commentLabel)
- .addComponent(scrollPane))
- .addContainerGap())
- );
-
- resolutionCombo.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(ResolveIssuePanel.class, "ResolveIssuePanel.resolutionCombo.AccessibleContext.accessibleDescription")); // NOI18N
- }// //GEN-END:initComponents
-
- private void duplicateButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_duplicateButtonActionPerformed
- Issue i = IssueQuickSearch.selectIssue(
- NbBundle.getMessage(IssuePanel.class, "IssuePanel.duplicateButton.message"), //NOI18N
- BugzillaUtil.getRepository(issue.getRepository()),
- this,
- new HelpCtx("org.netbeans.modules.bugzilla.duplicateChooser")); // NOI18N
- if (i != null) {
- duplicateField.setText(i.getID());
- }
-}//GEN-LAST:event_duplicateButtonActionPerformed
-
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- private javax.swing.JLabel commentLabel;
- private javax.swing.JButton duplicateButton;
- private javax.swing.JTextField duplicateField;
- private javax.swing.JLabel duplicateLabel;
- private javax.swing.JPanel duplicatePanel;
- private javax.swing.JComboBox resolutionCombo;
- private javax.swing.JLabel resolutionLabel;
- private javax.swing.JScrollPane scrollPane;
- private javax.swing.JTextArea textArea;
- // End of variables declaration//GEN-END:variables
-
- private void checkDuplicateId () {
- ok.setEnabled(!BugzillaIssue.RESOLVE_DUPLICATE.equals(resolutionCombo.getSelectedItem()) //NOI18N
- || duplicateField.getText().trim().length() > 0);
- }
-
- private void resolutionComboSelectionChanged () {
- boolean shown = BugzillaIssue.RESOLVE_DUPLICATE.equals(resolutionCombo.getSelectedItem()); // NOI18N
- duplicatePanel.setVisible(shown);
- checkDuplicateId();
- }
-
- boolean showDialog() {
- ok.getAccessibleContext().setAccessibleDescription(ok.getText());
- final DialogDescriptor dd = new DialogDescriptor(this, NbBundle.getMessage(ResolveIssuePanel.class, "BugzillaIssueProvider.resolveIssueButton.text"), //NOI18N
- true, new Object[]{ok, DialogDescriptor.CANCEL_OPTION}, ok,
- DialogDescriptor.DEFAULT_ALIGN, new HelpCtx(ResolveIssuePanel.class), null);
- duplicateField.getDocument().addDocumentListener(new DocumentListener() {
- @Override
- public void insertUpdate(DocumentEvent e) {
- checkDuplicateId();
- }
-
- @Override
- public void removeUpdate(DocumentEvent e) {
- checkDuplicateId();
- }
-
- @Override
- public void changedUpdate(DocumentEvent e) {
- checkDuplicateId();
- }
- });
- resolutionCombo.addActionListener(new ActionListener() {
- @Override
- public void actionPerformed(ActionEvent e) {
- resolutionComboSelectionChanged();
- }
- });
- resolutionComboSelectionChanged();
- return DialogDisplayer.getDefault().notify(dd) == ok;
- }
-
- String getDuplicateId() {
- return duplicateField.getText().trim();
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java
deleted file mode 100644
index dcf918338699..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQuery.java
+++ /dev/null
@@ -1,426 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.query;
-
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import java.util.*;
-import org.netbeans.modules.bugzilla.*;
-import java.util.logging.Level;
-import javax.swing.SwingUtilities;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugtracking.issuetable.ColumnDescriptor;
-import org.netbeans.modules.bugtracking.spi.IssueStatusProvider.Status;
-import org.netbeans.modules.team.spi.OwnerInfo;
-import org.netbeans.modules.team.commons.LogUtils;
-import org.netbeans.modules.bugzilla.util.BugzillaConstants;
-import org.netbeans.modules.mylyn.util.MylynSupport;
-import org.netbeans.modules.mylyn.util.NbTask;
-import org.netbeans.modules.mylyn.util.commands.SynchronizeQueryCommand;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaQuery {
-
- public static final String BUGZILLA_ADHOC_QUERY_PREFIX = "bugzilla ad-hoc query nr. ";
-
- private String name;
- private final BugzillaRepository repository;
- protected QueryController controller;
- private final Set issues = new HashSet<>();
-
- // XXX its not clear how the urlParam is used between query and controller
- protected String urlParameters;
- private boolean initialUrlDef;
-
- private boolean firstRun = true;
- private ColumnDescriptor[] columnDescriptors;
- private OwnerInfo info;
- private boolean saved;
- protected long lastRefresh;
- private IRepositoryQuery iquery;
-
- public BugzillaQuery(BugzillaRepository repository) {
- this(null, null, repository, null, false, false, true);
- }
-
- public BugzillaQuery (String name, BugzillaRepository repository, String urlParameters, boolean saved, boolean urlDef, boolean initControler) {
- this(name, null, repository, urlParameters, saved, urlDef, initControler);
- }
-
- public BugzillaQuery (String name, IRepositoryQuery query, BugzillaRepository repository, String urlParameters, boolean saved, boolean urlDef, boolean initControler) {
- this.repository = repository;
- this.saved = saved;
- this.name = name;
- this.iquery = query;
- this.urlParameters = urlParameters;
- this.initialUrlDef = urlDef;
- this.lastRefresh = BugzillaConfig.getInstance().getLastQueryRefresh(repository, getStoredQueryName());
-
- if(initControler) {
- controller = createControler(repository, this, urlParameters);
- }
- }
-
- public String getDisplayName() {
- return name;
- }
-
- public String getTooltip() {
- return name + " - " + repository.getDisplayName(); // NOI18N
- }
-
- public synchronized QueryController getController() {
- if (controller == null) {
- controller = createControler(repository, this, urlParameters);
- }
- return controller;
- }
-
- public BugzillaRepository getRepository() {
- return repository;
- }
-
- protected QueryController createControler(BugzillaRepository r, BugzillaQuery q, String parameters) {
- return new QueryController(r, q, parameters, initialUrlDef);
- }
-
- public ColumnDescriptor[] getColumnDescriptors() {
- if(columnDescriptors == null) {
- columnDescriptors = BugzillaIssue.getColumnDescriptors(repository);
- }
- return columnDescriptors;
- }
-
- boolean refreshIntern(final boolean autoRefresh) { // XXX what if already running! - cancel task
-
- assert urlParameters != null;
- assert !SwingUtilities.isEventDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
-
- final boolean ret[] = new boolean[1];
- executeQuery(new Runnable() {
- @Override
- public void run() {
- Bugzilla.LOG.log(Level.FINE, "refresh start - {0} [{1}]", new String[] {name, urlParameters}); // NOI18N
- try {
-
- // keeps all issues we will retrieve from the server
- // - those matching the query criteria
- // - and the obsolete ones
- issues.clear();
- if(isSaved()) {
- if(!wasRun() && !issues.isEmpty()) {
- Bugzilla.LOG.log(Level.WARNING, "query {0} supposed to be run for the first time yet already contains issues.", getDisplayName()); // NOI18N
- assert false;
- }
- }
- firstRun = false;
-
- // run query to know what matches the criteria
- StringBuilder url = new StringBuilder();
- url.append(BugzillaConstants.URL_ADVANCED_BUG_LIST);
- url.append(urlParameters); // XXX encode url?
- // IssuesIdCollector will populate the issues set
- try {
- if (iquery == null) {
- String qName = getStoredQueryName();
- if (qName == null || name == null) {
- qName = BUGZILLA_ADHOC_QUERY_PREFIX + System.currentTimeMillis(); //NOI18N
- }
- iquery = MylynSupport.getInstance().getRepositoryQuery(repository.getTaskRepository(), qName);
- if (iquery == null) {
- iquery = MylynSupport.getInstance().createNewQuery(repository.getTaskRepository(), qName);
- MylynSupport.getInstance().addQuery(repository.getTaskRepository(), iquery);
- }
- }
- String queryUrl = url.toString();
- iquery.setUrl(queryUrl);
- SynchronizeQueryCommand queryCmd = MylynSupport.getInstance().getCommandFactory()
- .createSynchronizeQueriesCommand(repository.getTaskRepository(), iquery);
- QueryProgressListener list = new QueryProgressListener();
- queryCmd.addCommandProgressListener(list);
- repository.getExecutor().execute(queryCmd, !autoRefresh);
- ret[0] = queryCmd.hasFailed();
- if (ret[0]) {
- if (isSaved()) {
- for (NbTask t : MylynSupport.getInstance().getTasks(iquery)) {
- // as a side effect creates a BugzillaIssue instance
- BugzillaIssue bzIssue = getRepository().getIssueForTask(t);
- if (bzIssue != null) {
- issues.add(bzIssue.getID());
- }
- }
- }
- list.notifyIssues(issues);
- return;
- }
-
- list.notifyIssues(issues);
-
- // but what about the archived issues?
- // they should be refreshed as well, but do we really care about them ?
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.INFO, null, ex);
- ret[0] = true;
- }
- } finally {
- BugzillaConfig.getInstance().putLastQueryRefresh(repository, getStoredQueryName(), System.currentTimeMillis());
- logQueryEvent(issues.size(), autoRefresh);
- Bugzilla.LOG.log(Level.FINE, "refresh finish - {0} [{1}]", new String[] {name, urlParameters}); // NOI18N
- }
- }
- });
-
- return ret[0];
- }
-
- public String getStoredQueryName() {
- return getDisplayName();
- }
-
- protected void logQueryEvent(int count, boolean autoRefresh) {
- LogUtils.logQueryEvent(
- BugzillaConnector.getConnectorName(),
- name,
- count,
- false,
- autoRefresh);
- }
-
- void refresh(String urlParameters, boolean autoReresh) {
- assert urlParameters != null;
- this.urlParameters = urlParameters;
- refreshIntern(autoReresh);
- }
-
- public void remove() {
- repository.removeQuery(this);
- }
-
- public void setOwnerInfo(OwnerInfo info) {
- this.info = info;
- }
-
- public OwnerInfo getOwnerInfo() {
- return info;
- }
-
- public Status getIssueStatus(String id) {
- return repository.getIssueCache().getIssue(id).getStatus();
- }
-
- int getSize() {
- return issues.size();
- }
-
- public String getUrlParameters() {
- return getController().getUrlParameters(false);
- }
-
- public boolean isUrlDefined() {
- return getController().isUrlDefined();
- }
-
- public void setName(String name) {
- this.name = name;
- if (iquery != null) {
- iquery.setSummary(name);
- }
- }
-
- public void setSaved(boolean saved) {
- if(saved) {
- info = null;
- }
- this.saved = saved;
- }
-
- public boolean isSaved() {
- return saved;
- }
-
- public Collection getIssues() {
- if (issues == null) {
- return Collections.emptyList();
- }
- List ids = new ArrayList<>();
- synchronized (issues) {
- ids.addAll(issues);
- }
-
- List ret = new ArrayList<>();
- for (String id : ids) {
- BugzillaIssue issue = repository.getIssueCache().getIssue(id);
- if (issue != null) {
- ret.add(issue);
- }
- }
- return ret;
- }
-
- boolean wasRun() {
- return !firstRun;
- }
-
- public long getLastRefresh() {
- return lastRefresh;
- }
-
- public boolean canRemove() {
- return true;
- }
-
- void delete() {
- if(iquery != null) {
- MylynSupport.getInstance().deleteQuery(iquery);
- }
- }
-
- private class QueryProgressListener implements SynchronizeQueryCommand.CommandProgressListener {
-
- private final Set addedIds = new HashSet();
-
- @Override
- public void queryRefreshStarted (Collection tasks) {
- for (NbTask task : tasks) {
- taskAdded(task);
- }
- }
-
- @Override
- public void tasksRefreshStarted (Collection tasks) {
- getController().switchToDeterminateProgress(tasks.size());
- }
-
- @Override
- public void taskAdded (NbTask task) {
- issues.add(task.getTaskId());
- // when issue table or task dashboard is able to handle deltas
- // fire an event from here
- }
-
- @Override
- public void taskRemoved (NbTask task) {
- issues.remove(task.getTaskId());
- BugzillaIssue issue = repository.getIssueForTask(task);
- if (issue != null) {
- fireNotifyDataRemoved(issue);
- }
- }
-
- @Override
- public void taskSynchronized (NbTask task) {
- getController().addProgressUnit(BugzillaIssue.getDisplayName(task));
- }
-
- private void notifyIssues (Set issues) {
- // this is due to the archived issues
- MylynSupport supp = MylynSupport.getInstance();
- try {
- for (String taskId : issues) {
- NbTask task = supp.getTask(repository.getUrl(), taskId);
- if (task != null) {
- BugzillaIssue issue = repository.getIssueForTask(task);
- if (issue != null) {
- if (addedIds.add(task.getTaskId())) {
- fireNotifyDataAdded(issue); // XXX - !!! triggers getIssues()
- }
- }
- }
- }
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.INFO, null, ex);
- }
- }
- };
-
- public void addNotifyListener(QueryNotifyListener l) {
- List list = getNotifyListeners();
- synchronized(list) {
- list.add(l);
- }
- }
-
- public void removeNotifyListener(QueryNotifyListener l) {
- List list = getNotifyListeners();
- synchronized(list) {
- list.remove(l);
- }
- }
-
- protected void fireNotifyDataAdded (BugzillaIssue issue) {
- QueryNotifyListener[] listeners = getListeners();
- for (QueryNotifyListener l : listeners) {
- l.notifyDataAdded(issue);
- }
- }
-
- protected void fireNotifyDataRemoved (BugzillaIssue issue) {
- QueryNotifyListener[] listeners = getListeners();
- for (QueryNotifyListener l : listeners) {
- l.notifyDataRemoved(issue);
- }
- }
-
- protected void fireStarted() {
- QueryNotifyListener[] listeners = getListeners();
- for (QueryNotifyListener l : listeners) {
- l.started();
- }
- }
-
- protected void fireFinished() {
- QueryNotifyListener[] listeners = getListeners();
- for (QueryNotifyListener l : listeners) {
- l.finished();
- }
- }
-
- // XXX move to API
- protected void executeQuery (Runnable r) {
- fireStarted();
- try {
- r.run();
- } finally {
- fireFinished();
- lastRefresh = System.currentTimeMillis();
- }
- }
-
- private QueryNotifyListener[] getListeners() {
- List list = getNotifyListeners();
- QueryNotifyListener[] listeners;
- synchronized (list) {
- listeners = list.toArray(new QueryNotifyListener[0]);
- }
- return listeners;
- }
-
- private List notifyListeners;
- private List getNotifyListeners() {
- if(notifyListeners == null) {
- notifyListeners = new ArrayList();
- }
- return notifyListeners;
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java
deleted file mode 100644
index 1891b6393da7..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/BugzillaQueryCellRenderer.java
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.query;
-
-import java.awt.Component;
-import javax.swing.JLabel;
-import javax.swing.JTable;
-import javax.swing.table.TableCellRenderer;
-import org.netbeans.modules.bugtracking.issuetable.QueryTableCellRenderer;
-import org.netbeans.modules.bugzilla.BugzillaConfig;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssueNode.PriorityProperty;
-
-/**
- *
- * @author Tomas Stupka
- *
- */
-public class BugzillaQueryCellRenderer implements TableCellRenderer {
-
- private final QueryTableCellRenderer defaultIssueRenderer;
-
- public BugzillaQueryCellRenderer(QueryTableCellRenderer defaultIssueRenderer) {
- this.defaultIssueRenderer = defaultIssueRenderer;
- }
-
- @Override
- public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) {
- JLabel renderer = (JLabel) defaultIssueRenderer.getTableCellRendererComponent(table, value, isSelected, hasFocus, row, column);
- if(!(value instanceof PriorityProperty)) {
- return renderer;
- }
- PriorityProperty p = (PriorityProperty) value;
- String priority = p.getValue();
- renderer.setIcon(BugzillaConfig.getInstance().getPriorityIcon(priority));
- return renderer;
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties
deleted file mode 100644
index 8f00a03d21f5..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/Bundle.properties
+++ /dev/null
@@ -1,149 +0,0 @@
-# Licensed to the Apache Software Foundation (ASF) under one
-# or more contributor license agreements. See the NOTICE file
-# distributed with this work for additional information
-# regarding copyright ownership. The ASF licenses this file
-# to you under the Apache License, Version 2.0 (the
-# "License"); you may not use this file except in compliance
-# with the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing,
-# software distributed under the License is distributed on an
-# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
-# KIND, either express or implied. See the License for the
-# specific language governing permissions and limitations
-# under the License.
-
-## libs/jsch/manifest.mf
-OpenIDE-Module-Name=Bugzilla
-QueryPanel.jLabel4.text=Product:
-QueryPanel.jLabel1.text=Name:
-QueryPanel.nameField.text=
-QueryPanel.jLabel2.text=...
-QueryPanel.jLabel1.text_1=Task ID:
-QueryPanel.byTextLabel.text_1=Find tasks by text
-QueryPanel.byDetailsLabel.text=Find by product details
-QueryPanel.byPeopleLabel.text=Find by people
-QueryPanel.byLastChangeLabel.text=Find by last change
-QueryPanel.bugAssigneeCheckBox.text=Assigned to
-QueryPanel.reporterCheckBox.text=Reporter
-QueryPanel.ccCheckBox.text=CC
-QueryPanel.commenterCheckBox.text=Commenter
-QueryPanel.gotoIssueButton.text=Go To Task
-QueryPanel.searchButton.text=Search
-QueryPanel.tableSummaryLabel.text_1=jLabel2
-QueryPanel.peopleLabel.text=Any one of:
-QueryPanel.versionLabel.text=Version
-QueryPanel.statusLabel.text=Status
-QueryPanel.resolutionLabel.text=Resolution
-QueryPanel.priorityLabel.text=Priority
-QueryPanel.summaryLabel.text_1=Summary:
-QueryPanel.commentLabel.text=Comment:
-QueryPanel.keywordsLabel.text=Keywords:
-QueryPanel.productLabel.text=Product
-QueryPanel.componentLabel.text=Component
-
-MSG_NoResults=No Tasks found
-MSG_Searching=Searching...
-MSG_SearchingQuery=Searching {0}...
-MSG_Opening=Opening Task {0} ...
-MSG_Populating=Reading server data from Task Repository ''{0}''...
-
-LBL_RetrievingIssue=Retrieved task {0}
-
-MSG_RemoveQuery=Do you want to remove the query ''{0}''?
-CTL_RemoveQuery=Remove
-
-QueryPanel.jLabel2.text_1=Query URL:
-QueryPanel.urlToggleButton.textForm=Create Query in Form
-QueryPanel.urlToggleButton.textUrl=Create Query as URL
-
-QueryPanel.nameLabel.text_1=jLabel4
-QueryPanel.filterLabel.text_1=Filter:
-QueryPanel.lastRefreshDateLabel.text_1=jLabel4
-QueryPanel.lastRefreshLabel.text_1=Last run:
-
-LBL_Never=Never
-QueryPanel.changedFromTextField.text=
-QueryPanel.changedToTextField.text=
-QueryPanel.changedLabel.text_1=Only bugs changed between:
-QueryPanel.changedAndLabel.text=and
-QueryPanel.changedWhereLabel.text=where
-# {$an_attribute_given_by_name_and_picked_from_a_list} has changed, and the new value was {$value}
-QueryPanel.changedBlaBlaLabel.text=has changed, and the new value was
-# YYYY-MM-DD is a date format
-QueryPanel.changedHintLabel.text=YYYY-MM-DD or relative dates
-QueryPanel.refreshButton.text=Refresh
-QueryPanel.modifyButton.text=Modify Query
-QueryPanel.seenButton.text=Mark All Tasks As Seen
-QueryPanel.removeButton.text=Remove Query
-QueryPanel.webButton.text=Open web Query
-LBL_MatchingIssues=There are {0} tasks matching this query.
-LBL_MatchingIssue=There is 1 task matching this query.
-QueryPanel.saveChangesButton.text=Save Changes
-QueryPanel.saveQueryButton.text=Save Query
-QueryPanel.cancelChangesButton.text=Cancel Changes
-QueryPanel.jLabel4.text_1=
-QueryPanel.jLabel5.text=
-QueryPanel.jLabel6.text=
-QueryPanel.keywordsButton.text=...
-
-LBL_SelectKeywords=Select or deselect keywords.
-QueryPanel.severityLabel.text=Severity
-QueryPanel.noContentLabel.text=jLabel9
-QueryPanel.savePanel.AccessibleContext.accessibleDescription=Save Query
-QueryPanel.queryNameTextField.AccessibleContext.accessibleDescription=Query Name
-QueryPanel.refreshConfigurationButton.text=Reload Attributes
-QueryPanel.summaryTextField.AccessibleContext.accessibleName=Summary
-QueryPanel.commentTextField.AccessibleContext.accessibleName=Comment
-QueryPanel.keywordsTextField.AccessibleContext.accessibleName=Keywords
-QueryPanel.peopleTextField.AccessibleContext.accessibleName=Username
-QueryPanel.peopleComboBox.AccessibleContext.accessibleName=Substring type
-QueryPanel.changedFromTextField.AccessibleContext.accessibleDescription=Start of the time range
-QueryPanel.changedToTextField.AccessibleContext.accessibleDescription=End of the time range
-QueryPanel.changedList.AccessibleContext.accessibleDescription=Changed field
-QueryPanel.newValueTextField.AccessibleContext.accessibleDescription=New value of the field
-QueryPanel.bugAssigneeCheckBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.reporterCheckBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.ccCheckBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.commenterCheckBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.peopleComboBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.peopleTextField.AccessibleContext.accessibleDescription=N/A
-QueryPanel.productList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.componentList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.versionList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.statusList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.resolutionList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.priorityList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.severityList.AccessibleContext.accessibleDescription=N/A
-QueryPanel.summaryComboBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.commentComboBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.keywordsComboBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.summaryTextField.AccessibleContext.accessibleDescription=N/A
-QueryPanel.commentTextField.AccessibleContext.accessibleDescription=N/A
-QueryPanel.keywordsTextField.AccessibleContext.accessibleDescription=N/A
-QueryPanel.keywordsButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.refreshButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.modifyButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.seenButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.removeButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.idTextField.AccessibleContext.accessibleDescription=N/A
-QueryPanel.gotoIssueButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.urlTextField.AccessibleContext.accessibleDescription=N/A
-QueryPanel.searchButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.saveChangesButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.cancelChangesButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.filterComboBox.AccessibleContext.accessibleDescription=N/A
-QueryPanel.refreshConfigurationButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.urlToggleButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.webButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.saveButton.AccessibleContext.accessibleDescription=N/A
-QueryPanel.separatorLabel2.text=
-QueryPanel.separatorLabel3.text=
-QueryPanel.jLabel7.text=
-QueryPanel.whiteboardLabel.text=Whiteboard:
-QueryPanel.issueTypeLabel.text=Task Type
-QueryPanel.tmLabel.text=Target Milestone
-QueryPanel.cloneQueryButton.text=Clone Query
-MSG_SAME_NAME=Query with the same name already exists.
\ No newline at end of file
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java
deleted file mode 100644
index 396c39290bbf..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryController.java
+++ /dev/null
@@ -1,1307 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.query;
-
-import org.netbeans.modules.bugtracking.commons.SaveQueryPanel;
-import java.awt.Component;
-import java.awt.EventQueue;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.FocusEvent;
-import java.awt.event.FocusListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.awt.event.KeyEvent;
-import java.awt.event.KeyListener;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.LinkedHashMap;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.MissingResourceException;
-import java.util.concurrent.Semaphore;
-import java.util.logging.Level;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.JComponent;
-import javax.swing.event.ChangeEvent;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import org.netbeans.api.progress.ProgressHandle;
-import org.netbeans.api.progress.ProgressHandleFactory;
-import org.netbeans.modules.bugtracking.issuetable.Filter;
-import org.netbeans.modules.bugtracking.issuetable.IssueTable;
-import org.netbeans.modules.bugtracking.issuetable.QueryTableCellRenderer;
-import org.netbeans.modules.bugtracking.commons.SaveQueryPanel.QueryNameValidator;
-import org.netbeans.modules.bugtracking.commons.UIUtils;
-import org.netbeans.modules.bugtracking.spi.QueryProvider;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.BugzillaConfig;
-import org.netbeans.modules.bugzilla.repository.BugzillaRepository;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.query.QueryParameter.AllWordsTextFieldParameter;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.netbeans.modules.bugzilla.query.QueryParameter.CheckBoxParameter;
-import org.netbeans.modules.bugzilla.query.QueryParameter.ComboParameter;
-import org.netbeans.modules.bugzilla.query.QueryParameter.EmptyValuesListParameter;
-import org.netbeans.modules.bugzilla.query.QueryParameter.ListParameter;
-import org.netbeans.modules.bugzilla.query.QueryParameter.ParameterValue;
-import org.netbeans.modules.bugzilla.query.QueryParameter.TextFieldParameter;
-import org.netbeans.modules.bugzilla.repository.BugzillaConfiguration;
-import org.netbeans.modules.bugzilla.util.BugzillaConstants;
-import org.openide.DialogDisplayer;
-import org.openide.NotifyDescriptor;
-import org.openide.awt.HtmlBrowser;
-import org.openide.util.Cancellable;
-import org.openide.util.HelpCtx;
-import org.openide.util.NbBundle;
-import org.openide.util.RequestProcessor;
-import org.openide.util.RequestProcessor.Task;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class QueryController implements org.netbeans.modules.bugtracking.spi.QueryController, ItemListener, ListSelectionListener, ActionListener, FocusListener, KeyListener, ChangeListener {
-
- protected QueryPanel panel;
-
- private static final String CHANGED_NOW = "Now"; // NOI18N
-
- private final ComboParameter summaryParameter;
- private final ComboParameter commentsParameter;
- private final ComboParameter whiteboardParameter;
- private final ComboParameter keywordsParameter;
- private final ComboParameter peopleParameter;
- private final ListParameter productParameter;
- private final ListParameter componentParameter;
- private final ListParameter versionParameter;
- private final ListParameter statusParameter;
- private final ListParameter resolutionParameter;
- private final ListParameter priorityParameter;
- private final ListParameter changedFieldsParameter;
- private final ListParameter severityParameter;
- private final ListParameter issueTypeParameter;
- private ListParameter tmParameter;
-
- private final Map parameters;
-
- private final RequestProcessor rp = new RequestProcessor("Bugzilla query", 1, true); // NOI18N
-
- private final BugzillaRepository repository;
- protected BugzillaQuery query;
-
- private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss"); // NOI18N
- private QueryTask refreshTask;
- private final IssueTable issueTable;
- private final boolean isNetbeans;
-
- private final Object REFRESH_LOCK = new Object();
- private final Semaphore querySemaphore = new Semaphore(1);
- private boolean populated = false;
- private boolean wasOpened;
- private boolean wasModeShow;
- private QueryProvider.IssueContainer delegatingIssueContainer;
-
- public QueryController(BugzillaRepository repository, BugzillaQuery query, String urlParameters, boolean urlDef) {
- this(repository, query, urlParameters, urlDef, true);
- }
-
- public QueryController(BugzillaRepository repository, BugzillaQuery query, String urlParameters, boolean urlDef, boolean populate) {
- this.repository = repository;
- this.query = query;
-
- issueTable = new IssueTable(repository.getID(), query.getDisplayName(), this, query.getColumnDescriptors(), query.isSaved());
- setupRenderer(issueTable);
- panel = new QueryPanel(issueTable.getComponent());
-
- isNetbeans = BugzillaUtil.isNbRepository(repository);
- panel.setNBFieldsVisible(isNetbeans);
-
- panel.productList.addListSelectionListener(this);
- panel.filterComboBox.addItemListener(this);
- panel.searchButton.addActionListener(this);
- panel.keywordsButton.addActionListener(this);
- panel.cancelChangesButton.addActionListener(this);
- panel.saveChangesButton.addActionListener(this);
- panel.gotoIssueButton.addActionListener(this);
- panel.webButton.addActionListener(this);
- panel.urlToggleButton.addActionListener(this);
- panel.refreshButton.addActionListener(this);
- panel.modifyButton.addActionListener(this);
- panel.seenButton.addActionListener(this);
- panel.removeButton.addActionListener(this);
- panel.refreshConfigurationButton.addActionListener(this);
- panel.cloneQueryButton.addActionListener(this);
- panel.changedFromTextField.addFocusListener(this);
-
- panel.idTextField.addActionListener(this);
- panel.productList.addKeyListener(this);
- panel.componentList.addKeyListener(this);
- panel.versionList.addKeyListener(this);
- panel.statusList.addKeyListener(this);
- panel.resolutionList.addKeyListener(this);
- panel.severityList.addKeyListener(this);
- panel.priorityList.addKeyListener(this);
- panel.changedList.addKeyListener(this);
- panel.tmList.addKeyListener(this);
-
- panel.summaryTextField.addActionListener(this);
- panel.commentTextField.addActionListener(this);
- panel.whiteboardTextField.addActionListener(this);
- panel.keywordsTextField.addActionListener(this);
- panel.peopleTextField.addActionListener(this);
- panel.changedFromTextField.addActionListener(this);
- panel.changedToTextField.addActionListener(this);
- panel.changedToTextField.addActionListener(this);
-
- // setup parameters
- parameters = new LinkedHashMap<>();
- summaryParameter = createQueryParameter(ComboParameter.class, panel.summaryComboBox, "short_desc_type"); // NOI18N
- commentsParameter = createQueryParameter(ComboParameter.class, panel.commentComboBox, "long_desc_type"); // NOI18N
- whiteboardParameter = createQueryParameter(ComboParameter.class, panel.whiteboardComboBox, "status_whiteboard_type"); // NOI18N
- keywordsParameter = createQueryParameter(ComboParameter.class, panel.keywordsComboBox, "keywords_type"); // NOI18N
- peopleParameter = createQueryParameter(ComboParameter.class, panel.peopleComboBox, "emailtype1"); // NOI18N
- productParameter = createQueryParameter(ListParameter.class, panel.productList, "product"); // NOI18N
- componentParameter = createQueryParameter(ListParameter.class, panel.componentList, "component"); // NOI18N
- versionParameter = createQueryParameter(ListParameter.class, panel.versionList, "version"); // NOI18N
- statusParameter = createQueryParameter(ListParameter.class, panel.statusList, "bug_status"); // NOI18N
- resolutionParameter = createQueryParameter(ListParameter.class, panel.resolutionList, "resolution"); // NOI18N
- priorityParameter = createQueryParameter(ListParameter.class, panel.priorityList, "priority"); // NOI18N
- changedFieldsParameter = createQueryParameter(EmptyValuesListParameter.class, panel.changedList, "chfield"); // NOI18N
- tmParameter = createQueryParameter(ListParameter.class, panel.tmList, "target_milestone"); // NOI18N
- if(isNetbeans) {
- issueTypeParameter = createQueryParameter(ListParameter.class, panel.issueTypeList, "cf_bug_type"); // NOI18N
- severityParameter = null;
- } else {
- severityParameter = createQueryParameter(ListParameter.class, panel.severityList, "bug_severity"); // NOI18N
- issueTypeParameter = null;
- }
-
- createQueryParameter(AllWordsTextFieldParameter.class, panel.summaryTextField, "short_desc"); // NOI18N
- createQueryParameter(AllWordsTextFieldParameter.class, panel.commentTextField, "long_desc"); // NOI18N
- createQueryParameter(AllWordsTextFieldParameter.class, panel.whiteboardTextField, "status_whiteboard"); // NOI18N
- createQueryParameter(TextFieldParameter.class, panel.keywordsTextField, "keywords"); // NOI18N
- createQueryParameter(TextFieldParameter.class, panel.peopleTextField, "email1"); // NOI18N
- createQueryParameter(CheckBoxParameter.class, panel.bugAssigneeCheckBox, "emailassigned_to1"); // NOI18N
- createQueryParameter(CheckBoxParameter.class, panel.reporterCheckBox, "emailreporter1"); // NOI18N
- createQueryParameter(CheckBoxParameter.class, panel.ccCheckBox, "emailcc1"); // NOI18N
- createQueryParameter(CheckBoxParameter.class, panel.commenterCheckBox, "emaillongdesc1"); // NOI18N
- createQueryParameter(TextFieldParameter.class, panel.changedFromTextField, "chfieldfrom"); // NOI18N
- createQueryParameter(TextFieldParameter.class, panel.changedToTextField, "chfieldto"); // NOI18N
- createQueryParameter(TextFieldParameter.class, panel.newValueTextField, "chfieldvalue"); // NOI18N
-
- for(QueryParameter p : parameters.values()) {
- p.addChangeListener(this);
- }
-
- panel.filterComboBox.setModel(new DefaultComboBoxModel(issueTable.getDefinedFilters()));
-
- if(query.isSaved()) {
- setAsSaved();
- } else {
- wasModeShow = true; // if not saved, means by default are issues shown
- }
-
- if(urlDef) {
- panel.switchQueryFields(false);
- panel.urlTextField.setText(urlParameters);
- populated = true;
- setChanged();
- } else {
- querySemaphore.acquireUninterruptibly();
- Bugzilla.LOG.log(Level.FINE, "lock aquired because populating {0}", query.getDisplayName()); // NOI18N
- postPopulate(urlParameters, false);
- }
- }
-
- private void setupRenderer(IssueTable issueTable) {
- BugzillaQueryCellRenderer renderer = new BugzillaQueryCellRenderer((QueryTableCellRenderer)issueTable.getRenderer());
- issueTable.setRenderer(renderer);
- }
-
- @Override
- public boolean providesMode(QueryMode mode) {
- return true;
- }
-
- @Override
- public void opened() {
- wasOpened = true;
- if(query.isSaved()) {
- setIssueCount(query.getSize());
- if(!query.wasRun()) {
- onRefresh();
- }
- if(refreshTask != null) {
- refreshTask.fillTableIfNeccessary();
- }
- }
- }
-
- @Override
- public void closed() {
- onCancelChanges();
- synchronized(REFRESH_LOCK) {
- if(refreshTask != null) {
- refreshTask.cancel();
- }
- }
- if(!query.isSaved()) {
- query.delete();
- }
- }
-
- private T createQueryParameter(Class clazz, Component c, String parameter) {
- try {
- Constructor constructor = clazz.getConstructor(c.getClass(), String.class, String.class);
- T t = constructor.newInstance(c, parameter, getRepository().getTaskRepository().getCharacterEncoding());
- parameters.put(parameter, t);
- return t;
- } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException ex) {
- Bugzilla.LOG.log(Level.SEVERE, parameter, ex);
- }
- return null;
- }
-
- @Override
- public JComponent getComponent(QueryMode mode) {
- setMode(mode);
- return panel;
- }
-
- @Override
- public HelpCtx getHelpCtx() {
- return new HelpCtx("org.netbeans.modules.bugzilla.query.BugzillaQuery"); // NOI18N
- }
-
- private void setMode(QueryMode mode) {
- switch(mode) {
- case EDIT:
- if(query.isSaved()) {
- onModify();
- }
- break;
- case VIEW:
- wasModeShow = true;
- onCancelChanges();
- selectFilter(issueTable.getAllFilter());
- break;
- default:
- throw new IllegalStateException("Unsupported mode " + mode);
- }
- }
-
- public String getUrlParameters(boolean encode) {
- if(panel.urlPanel.isVisible()) {
- return panel.urlTextField.getText();
- } else {
- StringBuilder sb = new StringBuilder();
- for (QueryParameter qp : parameters.values()) {
- sb.append(qp.get(encode));
- }
- return sb.toString();
- }
- }
-
- protected BugzillaRepository getRepository() {
- return repository;
- }
-
- protected void postPopulate(final String urlParameters, final boolean forceRefresh) {
-
- final Task[] t = new Task[1];
- Cancellable c = new Cancellable() {
- @Override
- public boolean cancel() {
- if(t[0] != null) {
- return t[0].cancel();
- }
- return true;
- }
- };
-
- final String msgPopulating = NbBundle.getMessage(QueryController.class, "MSG_Populating", new Object[]{repository.getDisplayName()}); // NOI18N
- final ProgressHandle handle = ProgressHandleFactory.createHandle(msgPopulating, c);
-
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- enableFields(false);
- panel.showRetrievingProgress(true, msgPopulating, !query.isSaved());
- handle.start();
- }
- });
-
- t[0] = rp.post(new Runnable() {
- @Override
- public void run() {
- try {
- if(forceRefresh) {
- repository.refreshConfiguration();
- }
- populate(urlParameters);
- } finally {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- enableFields(true);
- setChanged();
- handle.finish();
- panel.showRetrievingProgress(false, null, !query.isSaved());
- }
- });
- }
- }
- });
- }
-
- private boolean ignoreChanges = false;
- protected void populate(final String urlParameters) {
- if(Bugzilla.LOG.isLoggable(Level.FINE)) {
- Bugzilla.LOG.log(Level.FINE, "Starting populate query controller{0}", (query.isSaved() ? " - " + query.getDisplayName() : "")); // NOI18N
- }
- final BugzillaConfiguration bc = repository.getConfiguration();
- if(bc == null || !bc.isValid()) {
- // XXX nice errro msg?
- querySemaphore.release();
- return;
- }
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- ignoreChanges = true;
- try {
- productParameter.setParameterValues(toParameterValues(bc.getProducts()));
- populateProductDetails();
- if(isNetbeans) {
- issueTypeParameter.setParameterValues(toParameterValues(bc.getIssueTypes()));
- } else {
- severityParameter.setParameterValues(toParameterValues(bc.getSeverities()));
- }
- statusParameter.setParameterValues(toParameterValues(bc.getStatusValues()));
- resolutionParameter.setParameterValues(toParameterValues(getQueryResolutions(bc)));
- priorityParameter.setParameterValues(toParameterValues(bc.getPriorities()));
- changedFieldsParameter.setParameterValues(QueryParameter.PV_LAST_CHANGE);
- summaryParameter.setParameterValues(QueryParameter.PV_TEXT_SEARCH_VALUES);
- commentsParameter.setParameterValues(QueryParameter.PV_TEXT_SEARCH_VALUES);
- whiteboardParameter.setParameterValues(QueryParameter.PV_TEXT_SEARCH_VALUES);
- keywordsParameter.setParameterValues(QueryParameter.PV_KEYWORDS_VALUES);
- peopleParameter.setParameterValues(QueryParameter.PV_PEOPLE_VALUES);
- panel.changedToTextField.setText(CHANGED_NOW);
-
- setParameters(urlParameters != null ? urlParameters : getDefaultParameters());
-
- populated = true;
- Bugzilla.LOG.log(Level.FINE, "populated query {0}", query.getDisplayName()); // NOI18N
-
- } finally {
- resetParameters();
- ignoreChanges = false;
- querySemaphore.release();
- Bugzilla.LOG.log(Level.FINE, "released lock on query {0}", query.getDisplayName()); // NOI18N
-
- if(Bugzilla.LOG.isLoggable(Level.FINE)) {
- Bugzilla.LOG.log(Level.FINE, "Finnished populate query controller {0}", (query.isSaved() ? " - " + query.getDisplayName() : "")); // NOI18N
- }
- }
- }
- });
- }
-
- private String getDefaultParameters() {
- return BugzillaUtil.isNbRepository(repository) ? BugzillaConstants.DEFAULT_NB_STATUS_PARAMETERS : BugzillaConstants.DEFAULT_STATUS_PARAMETERS;
- }
-
- protected void enableFields(boolean bl) {
- // set all non parameter fields
- panel.enableFields(bl);
- // set the parameter fields
- for (Map.Entry e : parameters.entrySet()) {
- QueryParameter qp = parameters.get(e.getKey());
- qp.setEnabled(bl);
- }
- }
-
- protected void disableProduct() { // XXX whatever field
- productParameter.setAlwaysDisabled(true);
- }
-
- protected void selectFirstProduct() {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- if(panel.productList.getModel().getSize() > 0) {
- panel.productList.setSelectedIndex(0);
- }
- }
- });
- }
-
- @Override
- public void itemStateChanged(ItemEvent e) {
- if(e.getSource() == panel.filterComboBox) {
- onFilterChange((Filter)e.getItem());
- }
- }
-
- @Override
- public void valueChanged(ListSelectionEvent e) {
- if(e.getSource() == panel.productList) {
- onProductChanged(e);
- }
- }
-
- @Override
- public void focusGained(FocusEvent e) {
- if(panel.changedFromTextField.getText().equals("")) { // NOI18N
- String lastChangeFrom = BugzillaConfig.getInstance().getLastChangeFrom();
- panel.changedFromTextField.setText(lastChangeFrom);
- panel.changedFromTextField.setSelectionStart(0);
- panel.changedFromTextField.setSelectionEnd(lastChangeFrom.length());
- }
- }
-
- @Override
- public void focusLost(FocusEvent e) {
- // do nothing
- }
-
- @Override
- public void actionPerformed(ActionEvent e) {
- if(e.getSource() == panel.searchButton) {
- onRefresh();
- } else if (e.getSource() == panel.gotoIssueButton) {
- onGotoIssue();
- } else if (e.getSource() == panel.keywordsButton) {
- onKeywords();
- } else if (e.getSource() == panel.saveChangesButton) {
- onSave(); // refresh
- } else if (e.getSource() == panel.cancelChangesButton) {
- onCancelChanges();
- } else if (e.getSource() == panel.webButton) {
- onWeb();
- } else if (e.getSource() == panel.urlToggleButton) {
- onDefineAs();
- } else if (e.getSource() == panel.refreshButton) {
- onRefresh();
- } else if (e.getSource() == panel.modifyButton) {
- onModify();
- } else if (e.getSource() == panel.seenButton) {
- onMarkSeen();
- } else if (e.getSource() == panel.removeButton) {
- onRemove();
- } else if (e.getSource() == panel.refreshConfigurationButton) {
- onRefreshConfiguration();
- } else if (e.getSource() == panel.cloneQueryButton) {
- onCloneQuery();
- } else if (e.getSource() == panel.idTextField) {
- if(!panel.idTextField.getText().trim().equals("")) { // NOI18N
- onGotoIssue();
- }
- } else if (e.getSource() == panel.summaryTextField ||
- e.getSource() == panel.commentTextField ||
- e.getSource() == panel.keywordsTextField ||
- e.getSource() == panel.peopleTextField ||
- e.getSource() == panel.changedFromTextField ||
- e.getSource() == panel.newValueTextField ||
- e.getSource() == panel.changedToTextField)
- {
- onRefresh();
- }
- }
-
- @Override
- public void keyTyped(KeyEvent e) {
- // do nothing
- }
-
- @Override
- public void keyPressed(KeyEvent e) {
- // do nothing
- }
-
- @Override
- public void keyReleased(KeyEvent e) {
- if(e.getKeyCode() != KeyEvent.VK_ENTER) {
- return;
- }
- if(e.getSource() == panel.productList ||
- e.getSource() == panel.componentList ||
- e.getSource() == panel.versionList ||
- e.getSource() == panel.statusList ||
- e.getSource() == panel.resolutionList ||
- e.getSource() == panel.priorityList ||
- e.getSource() == panel.changedList)
- {
- onRefresh();
- }
- }
-
- private void onFilterChange(Filter filter) {
- selectFilter(filter);
- }
-
- private void onSave() {
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run() {
- saveSynchronously(null);
- }
- });
- }
-
- boolean saveSynchronously(String name) {
- Bugzilla.LOG.fine("on save start");
- boolean firstTime = !query.isSaved();
- if (firstTime) {
- name = name == null ? getSaveName() : name;
- if (name == null) {
- return false;
- }
- }
- name = name == null ? query.getDisplayName() : name;
- assert name != null;
- Bugzilla.LOG.log(Level.FINE, "saving query ''{0}''", new Object[]{name});
- save(name);
-
- if (!firstTime) {
- Bugzilla.LOG.log(Level.FINE, "refreshing query ''{0}'' after save", new Object[]{name});
- onRefresh();
- }
-
- Bugzilla.LOG.log(Level.FINE, "query ''{0}'' saved", new Object[]{name});
- Bugzilla.LOG.fine("on save finnish");
-
- return true;
- }
-
- void save(String name) {
- query.setName(name);
- saveQuery();
- query.setSaved(true);
- setAsSaved();
- fireChanged();
- }
-
- private String getSaveName() {
- QueryNameValidator v = new QueryNameValidator() {
- @Override
- public String isValid(String name) {
- Collection queries = repository.getQueries ();
- for (BugzillaQuery q : queries) {
- if(q.getDisplayName().equals(name)) {
- return NbBundle.getMessage(QueryController.class, "MSG_SAME_NAME");
- }
- }
- return null;
- }
- };
- return SaveQueryPanel.show(v, new HelpCtx("org.netbeans.modules.bugzilla.query.savePanel"));
- }
-
- private void onCancelChanges() {
- if(query.getDisplayName() != null) { // XXX need a better semantic - isSaved?
- String urlParameters = BugzillaConfig.getInstance().getUrlParams(repository, query.getDisplayName());
- if(urlParameters != null) {
- setParameters(urlParameters);
- }
- }
- setAsSaved();
- }
-
- public void selectFilter(final Filter filter) {
- if(filter != null) {
- // XXX this part should be handled in the issues table - move the filtercombo and the label over
- Collection issues = query.getIssues();
- int c = 0;
- if(issues != null) {
- for (BugzillaIssue issue : issues) {
- if(filter.accept(issue.getNode())) c++;
- }
- }
- final int issueCount = c;
-
- Runnable r = new Runnable() {
- @Override
- public void run() {
- panel.filterComboBox.setSelectedItem(filter);
- setIssueCount(issueCount);
- }
- };
- if(EventQueue.isDispatchThread()) {
- r.run();
- } else {
- EventQueue.invokeLater(r);
- }
- }
- issueTable.setFilter(filter);
- }
-
- private void setAsSaved() {
- panel.setSaved(query.getDisplayName(), getLastRefresh());
- panel.setModifyVisible(false);
- wasModeShow = true;
- }
-
- private String getLastRefresh() throws MissingResourceException {
- long l = query.getLastRefresh();
- return l > 0 ?
- dateFormat.format(new Date(l)) :
- NbBundle.getMessage(QueryController.class, "LBL_Never"); // NOI18N
- }
-
- private void onGotoIssue() {
- String idText = panel.idTextField.getText().trim();
- if(idText == null || idText.trim().equals("") ) { // NOI18N
- return;
- }
-
- final String id = idText.replaceAll("\\s", ""); // NOI18N
-
- final Task[] t = new Task[1];
- Cancellable c = new Cancellable() {
- @Override
- public boolean cancel() {
- if(t[0] != null) {
- return t[0].cancel();
- }
- return true;
- }
- };
- final ProgressHandle handle = ProgressHandleFactory.createHandle(NbBundle.getMessage(QueryController.class, "MSG_Opening", new Object[] {id}), c); // NOI18N
- t[0] = Bugzilla.getInstance().getRequestProcessor().create(new Runnable() {
- @Override
- public void run() {
- handle.start();
- try {
- openIssue(repository.getIssue(id));
- } finally {
- handle.finish();
- }
- }
- });
- t[0].schedule(0);
- }
-
- protected void openIssue(BugzillaIssue issue) {
- if (issue != null) {
- BugzillaUtil.openIssue(issue);
- } else {
- // XXX nice message?
- }
- }
-
- private void onWeb() {
- String params = getUrlParameters(true);
- String repoURL = repository.getTaskRepository().getRepositoryUrl() + "/query.cgi?format=advanced"; // NOI18N //XXX need constants
-
- final String urlString = repoURL + (params != null && !params.equals("") ? params : ""); // NOI18N
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run() {
- URL url;
- try {
- url = new URL(urlString);
- } catch (MalformedURLException ex) {
- Bugzilla.LOG.log(Level.SEVERE, null, ex);
- return;
- }
- HtmlBrowser.URLDisplayer displayer = HtmlBrowser.URLDisplayer.getDefault ();
- if (displayer != null) {
- displayer.showURL (url);
- } else {
- // XXX nice error message?
- Bugzilla.LOG.warning("No URLDisplayer found."); // NOI18N
- }
- }
- });
- }
-
- private void onProductChanged(ListSelectionEvent e) {
- Object[] values = panel.productList.getSelectedValues();
- String[] products = null;
- if(values != null) {
- products = new String[values.length];
- for (int i = 0; i < values.length; i++) {
- products[i] = ((ParameterValue) values[i]).getValue();
- }
- }
- populateProductDetails(products);
- }
-
- private void onDefineAs() {
- panel.switchQueryFields(panel.urlPanel.isVisible());
- }
-
- private void onKeywords() {
- String keywords = BugzillaUtil.getKeywords(NbBundle.getMessage(QueryController.class, "LBL_SelectKeywords"), panel.keywordsTextField.getText(), repository); // NOI18N
- if(keywords != null) {
- panel.keywordsTextField.setText(keywords);
- }
- }
-
- public void autoRefresh() {
- refresh(true, false);
- }
-
- public void refresh(boolean synchronously) {
- refresh(false, synchronously);
- }
-
- @NbBundle.Messages({"MSG_Changed=The query was changed and has to be saved before refresh.",
- "LBL_Save=Save",
- "LBL_Discard=Discard"})
- public void onRefresh() {
- if(query.isSaved() && isChanged()) {
- NotifyDescriptor desc = new NotifyDescriptor.Confirmation(
- Bundle.MSG_Changed(), NotifyDescriptor.YES_NO_CANCEL_OPTION
- );
- Object[] choose = { Bundle.LBL_Save(), Bundle.LBL_Discard(), NotifyDescriptor.CANCEL_OPTION };
- desc.setOptions(choose);
- Object ret = DialogDisplayer.getDefault().notify(desc);
- if(ret == choose[0]) {
- saveQuery(); // persist the parameters
- } else if (ret == choose[1]) {
- onCancelChanges();
- return;
- } else {
- return;
- }
- }
- refresh(false, false);
- }
-
- private void refresh(final boolean auto, boolean synchronously) {
- Task t;
- synchronized(REFRESH_LOCK) {
- if(refreshTask == null) {
- refreshTask = new QueryTask();
- } else {
- refreshTask.cancel();
- }
- t = refreshTask.post(auto);
- }
- if(synchronously) {
- t.waitFinished();
- }
- }
-
- private void onModify() {
- panel.setModifyVisible(true);
- }
-
- private void onMarkSeen() {
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run() {
- Collection issues = query.getIssues();
- for (BugzillaIssue issue : issues) {
- issue.setUpToDate(true);
- }
- }
- });
- }
-
- private void onRemove() {
- NotifyDescriptor nd = new NotifyDescriptor.Confirmation(
- NbBundle.getMessage(QueryController.class, "MSG_RemoveQuery", new Object[] { query.getDisplayName() }), // NOI18N
- NbBundle.getMessage(QueryController.class, "CTL_RemoveQuery"), // NOI18N
- NotifyDescriptor.OK_CANCEL_OPTION);
-
- if(DialogDisplayer.getDefault().notify(nd) == NotifyDescriptor.OK_OPTION) {
- Bugzilla.getInstance().getRequestProcessor().post(new Runnable() {
- @Override
- public void run() {
- remove();
- }
- });
- }
- }
-
- protected void onCloneQuery() {
- String p = getUrlParameters(false);
- BugzillaQuery q = new BugzillaQuery(null, getRepository(), p, false, isUrlDefined(), true);
- BugzillaUtil.openQuery(q);
- }
-
- private void onRefreshConfiguration() {
- postPopulate(getUrlParameters(false), true);
- }
-
- private void remove() {
- synchronized(REFRESH_LOCK) {
- if (refreshTask != null) {
- refreshTask.cancel();
- }
- }
- query.remove();
- }
-
- private void populateProductDetails(String... products) {
- BugzillaConfiguration bc = repository.getConfiguration();
- if(bc == null || !bc.isValid()) {
- // XXX nice errro msg?
- return;
- }
-
- // have to assure bc was loaded asyn, so do this here
- List targetMilestones = bc.getTargetMilestones(null);
- final boolean usingTargetMilestones = !targetMilestones.isEmpty();
-
- UIUtils.runInAWT(new Runnable() {
- public void run() {
- panel.tmLabel.setVisible(usingTargetMilestones);
- panel.tmList.setVisible(usingTargetMilestones);
- panel.tmScrollPane.setVisible(usingTargetMilestones);
- }
- });
-
- if(products == null || products.length == 0) {
- products = new String[] {null};
- }
-
- List newComponents = new ArrayList<>();
- List newVersions = new ArrayList<>();
- List newTargetMilestone = new ArrayList<>();
- for (String p : products) {
- List productComponents = bc.getComponents(p);
- for (String c : productComponents) {
- if(!newComponents.contains(c)) {
- newComponents.add(c);
- }
- }
- List productVersions = bc.getVersions(p);
- for (String c : productVersions) {
- if(!newVersions.contains(c)) {
- newVersions.add(c);
- }
- }
- if(usingTargetMilestones) {
- List targetMilestone = bc.getTargetMilestones(p);
- for (String c : targetMilestone) {
- if(!newTargetMilestone.contains(c)) {
- newTargetMilestone.add(c);
- }
- }
- }
- }
-
- Collections.sort(newComponents);
- Collections.sort(newVersions);
-
- componentParameter.setParameterValues(toParameterValues(newComponents));
- versionParameter.setParameterValues(toParameterValues(newVersions));
- if(usingTargetMilestones) {
- tmParameter.setParameterValues(toParameterValues(newTargetMilestone));
- }
- }
-
- private List toParameterValues(List values) {
- List ret = new ArrayList<>(values.size());
- for (String v : values) {
- ret.add(new ParameterValue(v, v));
- }
- return ret;
- }
-
- private void setParameters(String urlParameters) {
- if(urlParameters == null) {
- return;
- }
- String[] params = urlParameters.split("&"); // NOI18N
- if(params == null || params.length == 0) return;
- Map> normalizedParams = new HashMap<>();
- for (String p : params) {
- int idx = p.indexOf("="); // NOI18N
- if(idx > -1) {
- String parameter = p.substring(0, idx);
- String value = p.substring(idx + 1);
-
- ParameterValue pv = new ParameterValue(value, value);
- List values = normalizedParams.get(parameter);
- if(values == null) {
- values = new ArrayList<>();
- normalizedParams.put(parameter, values);
- }
- values.add(pv);
- } else {
- // XXX warning!!
- }
- }
-
- List componentPV = null;
- List versionPV = null;
- for (Map.Entry> e : normalizedParams.entrySet()) {
- QueryParameter qp = parameters.get(e.getKey());
- if(qp != null) {
- if(qp == componentParameter) {
- componentPV = e.getValue();
- } else if(qp == versionParameter) {
- versionPV = e.getValue();
- } else {
- List pvs = e.getValue();
- qp.setValues(pvs.toArray(new ParameterValue[0]));
- }
- }
- }
- setDependentParameter(componentParameter, componentPV);
- setDependentParameter(versionParameter, versionPV);
- }
-
- private void setDependentParameter(QueryParameter qp, List values) {
- if(values != null) {
- qp.setValues(values.toArray(new ParameterValue[0]));
- }
- }
-
- private void setIssueCount(final int count) {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- String msg =
- count == 1 ?
- NbBundle.getMessage(QueryController.class, "LBL_MatchingIssue", new Object[] {count}) : // NOI18N
- NbBundle.getMessage(QueryController.class, "LBL_MatchingIssues", new Object[] {count}); // NOI18N
- panel.tableSummaryLabel.setText(msg);
- }
- });
- }
-
- boolean isUrlDefined() {
- return panel.urlPanel.isVisible();
- }
-
- void switchToDeterminateProgress(long issuesCount) {
- synchronized(REFRESH_LOCK) {
- if(refreshTask != null) {
- refreshTask.switchToDeterminateProgress(issuesCount);
- }
- }
- }
-
- void addProgressUnit(String issueDesc) {
- synchronized(REFRESH_LOCK) {
- if(refreshTask != null) {
- refreshTask.addProgressUnit(issueDesc);
- }
- }
- }
-
- @Override
- public void stateChanged(ChangeEvent e) {
- setChanged();
- }
-
- public void setChanged() {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- panel.saveChangesButton.setEnabled((!ignoreChanges && isChanged()) || !query.isSaved());
- fireChanged();
- }
- });
- }
-
- @Override
- public boolean isChanged() {
- for(QueryParameter p : parameters.values()) {
- if(p.isChanged()) {
- return true;
- }
- }
- return false;
- }
-
- private List getQueryResolutions(BugzillaConfiguration bc) {
- List l = new ArrayList<>(bc.getResolutions());
- l.add(0, "---");
- return l;
- }
-
- private void resetParameters() {
- for(QueryParameter p : parameters.values()) {
- p.reset();
- }
- }
-
- private void saveQuery() {
- String name = query.getDisplayName();
- Bugzilla.LOG.log(Level.FINE, "saving query ''{0}''", new Object[]{name}); // NOI18N
- repository.saveQuery(query);
- resetParameters();
- Bugzilla.LOG.log(Level.FINE, "query ''{0}'' saved", new Object[]{name}); // NOI18N
- }
-
- @Override
- public boolean saveChanges(String name) {
- return saveSynchronously(name);
- }
-
- @Override
- public boolean discardUnsavedChanges() {
- onCancelChanges();
- return true;
- }
-
- private final PropertyChangeSupport support = new PropertyChangeSupport(this);
- @Override
- public void addPropertyChangeListener(PropertyChangeListener l) {
- support.addPropertyChangeListener(l);
- }
-
- @Override
- public void removePropertyChangeListener(PropertyChangeListener l) {
- support.removePropertyChangeListener(l);
- }
-
- private void fireChanged() {
- support.firePropertyChange(QueryController.PROP_CHANGED, null, null);
- }
-
- /**
- * package private for testing purposes
- */
- IssueTable getIssueTable() {
- return issueTable;
- }
-
- public void setContainer(QueryProvider.IssueContainer c) {
- delegatingIssueContainer = c;
- }
-
- private class QueryTask implements Runnable, Cancellable, QueryNotifyListener {
- private ProgressHandle handle;
- private Task task;
- private int counter;
- private boolean autoRefresh;
- private long progressMaxWorkunits;
- private int progressWorkunits;
- private final LinkedList notifiedIssues = new LinkedList<>();
-
- public QueryTask() {
- query.addNotifyListener(this);
- }
-
- private void startQuery() {
- // NOI18N
- String displayName = query.getDisplayName() != null ? query.getDisplayName() + " (" + repository.getDisplayName() + ")" // NOI18N
- : repository.getDisplayName();
- handle = ProgressHandleFactory.createHandle(
- NbBundle.getMessage(
- QueryController.class,
- "MSG_SearchingQuery", // NOI18N
- new Object[]{
- displayName}),
- this);
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- enableFields(false);
- panel.showSearchingProgress(true, NbBundle.getMessage(QueryController.class, "MSG_Searching")); // NOI18N
- }
- });
- if(delegatingIssueContainer != null) {
- delegatingIssueContainer.refreshingStarted();
- }
- handle.start();
- }
-
- private void finnishQuery() {
- task = null;
- if(delegatingIssueContainer != null) {
- delegatingIssueContainer.refreshingFinished();
- }
- if(handle != null) {
- handle.finish();
- handle = null;
- }
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- panel.setQueryRunning(false);
- panel.setLastRefresh(getLastRefresh());
- panel.showNoContentPanel(false);
- enableFields(true);
- }
- });
- }
-
- void switchToDeterminateProgress(long progressMaxWorkunits) {
- if(handle != null) {
- handle.switchToDeterminate((int) progressMaxWorkunits);
- this.progressMaxWorkunits = progressMaxWorkunits;
- this.progressWorkunits = 0;
- }
- }
-
- void addProgressUnit(String issueDesc) {
- if(handle != null && progressWorkunits < progressMaxWorkunits) {
- handle.progress(
- NbBundle.getMessage(
- QueryController.class, "LBL_RetrievingIssue", new Object[] {issueDesc}),
- ++progressWorkunits);
- }
- }
-
- private void executeQuery() {
- setQueryRunning(true);
- // XXX isn't persistent and should be merged with refresh
- String lastChageFrom = panel.changedFromTextField.getText().trim();
- if(lastChageFrom != null && !lastChageFrom.equals("")) { // NOI18N
- BugzillaConfig.getInstance().setLastChangeFrom(lastChageFrom);
- }
- try {
- if (panel.urlPanel.isVisible()) {
- // XXX check url format etc...
- // XXX what if there is a different host in queries repository as in the url?
- query.refresh(panel.urlTextField.getText(), autoRefresh);
- } else {
- query.refresh(getUrlParameters(true), autoRefresh);
- }
- } finally {
- setQueryRunning(false); // XXX do we need this? its called in finishQuery anyway
- task = null;
- }
-
- }
-
- private void setQueryRunning(final boolean running) {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- panel.setQueryRunning(running);
- }
- });
- }
-
- @Override
- public void run() {
- startQuery();
- try {
- Bugzilla.LOG.log(Level.FINE, "waiting until lock releases in query {0}", query.getDisplayName()); // NOI18N
- long t = System.currentTimeMillis();
- try {
- querySemaphore.acquire();
- } catch (InterruptedException ex) {
- Bugzilla.LOG.log(Level.INFO, "interuped while trying to lock query", ex); // NOI18N
- return;
- }
- querySemaphore.release();
- Bugzilla.LOG.log(Level.FINE, "lock aquired for query {0} after {1}", new Object[]{query.getDisplayName(), System.currentTimeMillis() - t}); // NOI18N
- if(!populated) {
- Bugzilla.LOG.log(Level.WARNING, "Skipping refresh of query {0} because isn''t populated.", query.getDisplayName()); // NOI18N
- // something went wrong during populate - skip execute
- return;
- }
- executeQuery();
- } finally {
- finnishQuery();
- }
- }
-
- Task post(boolean autoRefresh) {
- Task t = task;
- if (t != null) {
- t.cancel();
- }
- task = t = rp.create(this);
- this.autoRefresh = autoRefresh;
- t.schedule(0);
- return t;
- }
-
- @Override
- public boolean cancel() {
- Task t = task;
- if (t != null) {
- t.cancel();
- finnishQuery();
- }
- return true;
- }
-
- @Override
- public void notifyDataAdded (final BugzillaIssue issue) {
- if(delegatingIssueContainer != null) {
- delegatingIssueContainer.add(issue);
- }
- if(wasOpened && wasModeShow) {
- issueTable.addNode(issue.getNode());
- } else {
- synchronized(notifiedIssues) {
- notifiedIssues.add(issue);
- }
- }
- setIssueCount(++counter);
- if(counter == 1) {
- EventQueue.invokeLater(new Runnable() {
- @Override
- public void run() {
- panel.showNoContentPanel(false);
- }
- });
- }
- }
-
- @Override
- public void notifyDataRemoved (final BugzillaIssue issue) {
- if(delegatingIssueContainer != null) {
- delegatingIssueContainer.remove(issue);
- }
- // issue table cannot remove data
- }
-
- @Override
- public void started() {
- issueTable.started();
- counter = 0;
- synchronized(notifiedIssues) {
- notifiedIssues.clear();
- }
- setIssueCount(counter);
- }
-
- @Override
- public void finished() { }
-
- void fillTableIfNeccessary() {
- synchronized(notifiedIssues) {
- for (BugzillaIssue issue : notifiedIssues) {
- issueTable.addNode(issue.getNode());
- }
- notifiedIssues.clear();
- }
- }
-
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java
deleted file mode 100644
index 1b90d1d34a70..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryNotifyListener.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.query;
-
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-
-/**
- * Notifies changes on a query
- * @author Tomas Stupka
- */
-public interface QueryNotifyListener {
-
- /**
- * Query execution was started
- */
- public void started();
-
- /**
- *
- * @param issue
- */
- public void notifyDataAdded (BugzillaIssue issue);
-
- /**
- *
- * @param issue
- */
- public void notifyDataRemoved (BugzillaIssue issue);
-
- /**
- * Query execution was finished
- */
- public void finished();
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form
deleted file mode 100644
index 6fbe51ab5178..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.form
+++ /dev/null
@@ -1,2109 +0,0 @@
-
-
-
-
-
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java
deleted file mode 100644
index f1120a108c0c..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryPanel.java
+++ /dev/null
@@ -1,1479 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.query;
-
-import java.awt.Color;
-import java.awt.Component;
-import java.awt.Dimension;
-import java.awt.Font;
-import java.awt.event.FocusEvent;
-import java.awt.event.MouseAdapter;
-import java.awt.event.MouseEvent;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.Icon;
-import javax.swing.JComponent;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JPanel;
-import javax.swing.JScrollPane;
-import javax.swing.JTree;
-import javax.swing.plaf.basic.BasicTreeUI;
-import org.netbeans.modules.bugtracking.issuetable.Filter;
-import org.netbeans.modules.bugtracking.commons.UIUtils;
-import org.netbeans.modules.bugzilla.query.QueryParameter.ParameterValueCellRenderer;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-
-/**
- *
- * @author Tomas Stupka, Jan Stola
- */
-public class QueryPanel extends javax.swing.JPanel {
-
- final ExpandablePanel byText;
- final ExpandablePanel byDetails;
- final ExpandablePanel byPeople;
- final ExpandablePanel byLastChange;
- private final Color defaultTextColor;
-
- /** Creates new form QueryPanel */
- public QueryPanel(JComponent tableComponent) {
- initComponents();
-
- Color bkColor = UIUtils.getSectionPanelBackground();
- gotoPanel.setBackground( bkColor );
- tablePanel.setBackground( bkColor );
- urlPanel.setBackground( bkColor );
- criteriaPanel.setBackground( bkColor );
-
- Font f = new JLabel().getFont();
- int s = f.getSize();
- nameLabel.setFont(jLabel1.getFont().deriveFont(s * 1.7f));
- defaultTextColor = noContentLabel.getForeground();
-
- tablePanel.add(tableComponent);
-
- JTree tv = new JTree();
- BasicTreeUI tvui = (BasicTreeUI) tv.getUI();
- Icon ei = tvui.getExpandedIcon();
- Icon ci = tvui.getCollapsedIcon();
-
- byTextContainer.add(byTextPanel);
- byDetailsContainer.add(byDetailsPanel);
- byPeopleContainer.add(byPeoplePanel);
- byLastChangeContainer.add(byLastChangePanel);
-
- byText = new ExpandablePanel(byTextLabel, byTextContainer, ei, ci);
- byDetails = new ExpandablePanel(byDetailsLabel, byDetailsContainer, ei, ci);
- byPeople = new ExpandablePanel(byPeopleLabel, byPeopleContainer, ei, ci);
- byLastChange = new ExpandablePanel(byLastChangeLabel, byLastChangeContainer, ei, ci);
-
- byText.expand();
- byDetails.expand();
- byPeople.colapse();
- byLastChange.colapse();
-
- urlPanel.setVisible(false);
- queryHeaderPanel.setVisible(false);
- tableFieldsPanel.setVisible(false);
- cancelChangesButton.setVisible(false);
- filterComboBox.setVisible(false);
- filterLabel.setVisible(false);
- noContentPanel.setVisible(false);
-
- saveChangesButton.setEnabled(false);
-
- bugAssigneeCheckBox.setOpaque(false);
- reporterCheckBox.setOpaque(false);
- ccCheckBox.setOpaque(false);
- commenterCheckBox.setOpaque(false);
-
- summaryComboBox.setModel(new DefaultComboBoxModel());
- commentComboBox.setModel(new DefaultComboBoxModel());
- keywordsComboBox.setModel(new DefaultComboBoxModel());
- peopleComboBox.setModel(new DefaultComboBoxModel());
-
- summaryComboBox.setRenderer(new ParameterValueCellRenderer());
- commentComboBox.setRenderer(new ParameterValueCellRenderer());
- whiteboardComboBox.setRenderer(new ParameterValueCellRenderer());
- keywordsComboBox.setRenderer(new ParameterValueCellRenderer());
- peopleComboBox.setRenderer(new ParameterValueCellRenderer());
- severityList.setCellRenderer(new ParameterValueCellRenderer());
- issueTypeList.setCellRenderer(new ParameterValueCellRenderer());
- productList.setCellRenderer(new ParameterValueCellRenderer());
- componentList.setCellRenderer(new ParameterValueCellRenderer());
- versionList.setCellRenderer(new ParameterValueCellRenderer());
- statusList.setCellRenderer(new ParameterValueCellRenderer());
- resolutionList.setCellRenderer(new ParameterValueCellRenderer());
- priorityList.setCellRenderer(new QueryParameter.PriorityRenderer());
- changedList.setCellRenderer(new ParameterValueCellRenderer());
- tmList.setCellRenderer(new ParameterValueCellRenderer());
-
- filterComboBox.setRenderer(new FilterCellRenderer());
-
- UIUtils.keepFocusedComponentVisible(this);
- UIUtils.keepComponentsWidthByVisibleArea(this, new UIUtils.SizeController() {
- @Override
- public void setWidth(int width) {
- setContainerSize(byTextContainer, width, byTextPanel.getPreferredSize().height);
- setContainerSize(byPeopleContainer, width, byPeoplePanel.getPreferredSize().height);
- setContainerSize(byLastChangeContainer, width, byLastChangePanel.getPreferredSize().height);
- }
- private void setContainerSize(JComponent cmp, int width, int height) {
- cmp.setPreferredSize(new Dimension(width, height));
- cmp.revalidate();
- }
- });
-
- validate();
- repaint();
- }
-
- void setQueryRunning(final boolean running) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- modifyButton.setEnabled(!running);
- seenButton.setEnabled(!running);
- removeButton.setEnabled(!running);
- refreshButton.setEnabled(!running);
- filterLabel.setEnabled(!running);
- filterComboBox.setEnabled(!running);
- }
- });
- }
-
- /** This method is called from within the constructor to
- * initialize the form.
- * WARNING: Do NOT modify this code. The content of this method is
- * always regenerated by the Form Editor.
- */
- @SuppressWarnings("unchecked")
- // //GEN-BEGIN:initComponents
- private void initComponents() {
-
- byLastChangePanel = new javax.swing.JPanel();
- changedLabel = new javax.swing.JLabel();
- changedAndLabel = new javax.swing.JLabel();
- changedHintLabel = new javax.swing.JLabel();
- changedWhereLabel = new javax.swing.JLabel();
- jScrollPane1 = new javax.swing.JScrollPane();
- changedBlaBlaLabel = new javax.swing.JLabel();
- byPeoplePanel = new javax.swing.JPanel();
- byTextPanel = new javax.swing.JPanel();
- tableFieldsPanel = new javax.swing.JPanel();
- tableHeaderPanel = new javax.swing.JPanel();
- filterLabel = new javax.swing.JLabel();
- criteriaPanel = new javax.swing.JPanel();
- jLabel2 = new javax.swing.JLabel();
- jLabel1 = new javax.swing.JLabel();
- separatorLabel2 = new javax.swing.JLabel();
- separatorLabel3 = new javax.swing.JLabel();
- queryHeaderPanel = new javax.swing.JPanel();
- lastRefreshLabel = new javax.swing.JLabel();
- jLabel4 = new javax.swing.JLabel();
- jLabel5 = new javax.swing.JLabel();
- jLabel6 = new javax.swing.JLabel();
- jLabel7 = new javax.swing.JLabel();
- noContentPanel = new javax.swing.JPanel();
- noContentLabel = new javax.swing.JLabel();
-
- byLastChangePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- changedLabel.setLabelFor(changedFromTextField);
- org.openide.awt.Mnemonics.setLocalizedText(changedLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedLabel.text_1")); // NOI18N
-
- changedFromTextField.setColumns(8);
- changedFromTextField.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedFromTextField.text")); // NOI18N
-
- changedAndLabel.setLabelFor(changedToTextField);
- org.openide.awt.Mnemonics.setLocalizedText(changedAndLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedAndLabel.text")); // NOI18N
-
- changedToTextField.setColumns(8);
- changedToTextField.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedToTextField.text")); // NOI18N
-
- changedHintLabel.setForeground(javax.swing.UIManager.getDefaults().getColor("Label.disabledForeground"));
- org.openide.awt.Mnemonics.setLocalizedText(changedHintLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedHintLabel.text")); // NOI18N
-
- changedWhereLabel.setLabelFor(changedList);
- org.openide.awt.Mnemonics.setLocalizedText(changedWhereLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedWhereLabel.text")); // NOI18N
-
- jScrollPane1.setViewportView(changedList);
- changedList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedList.AccessibleContext.accessibleDescription")); // NOI18N
-
- changedBlaBlaLabel.setLabelFor(newValueTextField);
- org.openide.awt.Mnemonics.setLocalizedText(changedBlaBlaLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedBlaBlaLabel.text")); // NOI18N
-
- newValueTextField.setColumns(20);
-
- javax.swing.GroupLayout byLastChangePanelLayout = new javax.swing.GroupLayout(byLastChangePanel);
- byLastChangePanel.setLayout(byLastChangePanelLayout);
- byLastChangePanelLayout.setHorizontalGroup(
- byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byLastChangePanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byLastChangePanelLayout.createSequentialGroup()
- .addComponent(changedLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(changedHintLabel)
- .addGroup(byLastChangePanelLayout.createSequentialGroup()
- .addComponent(changedFromTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(changedAndLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(changedToTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addGap(0, 253, Short.MAX_VALUE))
- .addGroup(byLastChangePanelLayout.createSequentialGroup()
- .addComponent(changedWhereLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 216, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(changedBlaBlaLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(newValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)))
- .addContainerGap())
- );
- byLastChangePanelLayout.setVerticalGroup(
- byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byLastChangePanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(changedLabel)
- .addComponent(changedAndLabel)
- .addComponent(changedToTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(changedFromTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(4, 4, 4)
- .addComponent(changedHintLabel)
- .addGap(18, 18, 18)
- .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(changedWhereLabel)
- .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 71, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(byLastChangePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(changedBlaBlaLabel)
- .addComponent(newValueTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
-
- changedFromTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedFromTextField.AccessibleContext.accessibleDescription")); // NOI18N
- changedToTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.changedToTextField.AccessibleContext.accessibleDescription")); // NOI18N
- newValueTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.newValueTextField.AccessibleContext.accessibleDescription")); // NOI18N
-
- byPeoplePanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- org.openide.awt.Mnemonics.setLocalizedText(peopleLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleLabel.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(bugAssigneeCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.bugAssigneeCheckBox.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(reporterCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.reporterCheckBox.text")); // NOI18N
- reporterCheckBox.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- reporterCheckBoxActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(ccCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.ccCheckBox.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(commenterCheckBox, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commenterCheckBox.text")); // NOI18N
-
- peopleComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- peopleTextField.setColumns(17);
-
- javax.swing.GroupLayout byPeoplePanelLayout = new javax.swing.GroupLayout(byPeoplePanel);
- byPeoplePanel.setLayout(byPeoplePanelLayout);
- byPeoplePanelLayout.setHorizontalGroup(
- byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byPeoplePanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(peopleLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(commenterCheckBox)
- .addComponent(ccCheckBox)
- .addGroup(byPeoplePanelLayout.createSequentialGroup()
- .addComponent(bugAssigneeCheckBox)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(peopleComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(7, 7, 7)
- .addComponent(peopleTextField))
- .addComponent(reporterCheckBox))
- .addContainerGap())
- );
- byPeoplePanelLayout.setVerticalGroup(
- byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byPeoplePanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
- .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(peopleComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(peopleTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGroup(byPeoplePanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(bugAssigneeCheckBox)
- .addComponent(peopleLabel)))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(reporterCheckBox)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(ccCheckBox)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(commenterCheckBox)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
-
- bugAssigneeCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.bugAssigneeCheckBox.AccessibleContext.accessibleDescription")); // NOI18N
- reporterCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.reporterCheckBox.AccessibleContext.accessibleDescription")); // NOI18N
- ccCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.ccCheckBox.AccessibleContext.accessibleDescription")); // NOI18N
- commenterCheckBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commenterCheckBox.AccessibleContext.accessibleDescription")); // NOI18N
- peopleComboBox.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleComboBox.AccessibleContext.accessibleName")); // NOI18N
- peopleComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleComboBox.AccessibleContext.accessibleDescription")); // NOI18N
- peopleTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleTextField.AccessibleContext.accessibleName")); // NOI18N
- peopleTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.peopleTextField.AccessibleContext.accessibleDescription")); // NOI18N
-
- byDetailsPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- productLabel.setFont(productLabel.getFont().deriveFont(productLabel.getFont().getStyle() | java.awt.Font.BOLD));
- productLabel.setLabelFor(productList);
- org.openide.awt.Mnemonics.setLocalizedText(productLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.productLabel.text")); // NOI18N
-
- versionLabel.setFont(versionLabel.getFont().deriveFont(versionLabel.getFont().getStyle() | java.awt.Font.BOLD));
- versionLabel.setLabelFor(versionList);
- org.openide.awt.Mnemonics.setLocalizedText(versionLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.versionLabel.text")); // NOI18N
-
- versionScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- versionList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- versionList.setVisibleRowCount(6);
- versionScrollPane.setViewportView(versionList);
- versionList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.versionList.AccessibleContext.accessibleDescription")); // NOI18N
-
- statusLabel.setFont(statusLabel.getFont().deriveFont(statusLabel.getFont().getStyle() | java.awt.Font.BOLD));
- statusLabel.setLabelFor(statusList);
- org.openide.awt.Mnemonics.setLocalizedText(statusLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.statusLabel.text")); // NOI18N
-
- statusScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- statusList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- statusList.setVisibleRowCount(6);
- statusScrollPane.setViewportView(statusList);
- statusList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.statusList.AccessibleContext.accessibleDescription")); // NOI18N
-
- resolutionLabel.setFont(resolutionLabel.getFont().deriveFont(resolutionLabel.getFont().getStyle() | java.awt.Font.BOLD));
- resolutionLabel.setLabelFor(resolutionList);
- org.openide.awt.Mnemonics.setLocalizedText(resolutionLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.resolutionLabel.text")); // NOI18N
-
- priorityScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- priorityList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- priorityList.setVisibleRowCount(6);
- priorityScrollPane.setViewportView(priorityList);
- priorityList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.priorityList.AccessibleContext.accessibleDescription")); // NOI18N
-
- priorityLabel.setFont(priorityLabel.getFont().deriveFont(priorityLabel.getFont().getStyle() | java.awt.Font.BOLD));
- priorityLabel.setLabelFor(priorityList);
- org.openide.awt.Mnemonics.setLocalizedText(priorityLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.priorityLabel.text")); // NOI18N
-
- resolutionScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- resolutionList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- resolutionList.setVisibleRowCount(6);
- resolutionScrollPane.setViewportView(resolutionList);
- resolutionList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.resolutionList.AccessibleContext.accessibleDescription")); // NOI18N
-
- componentLabel.setFont(componentLabel.getFont().deriveFont(componentLabel.getFont().getStyle() | java.awt.Font.BOLD));
- componentLabel.setLabelFor(componentList);
- org.openide.awt.Mnemonics.setLocalizedText(componentLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.componentLabel.text")); // NOI18N
-
- componentScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- componentList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- componentList.setVisibleRowCount(6);
- componentScrollPane.setViewportView(componentList);
- componentList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.componentList.AccessibleContext.accessibleDescription")); // NOI18N
-
- productScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- productList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- productList.setVisibleRowCount(6);
- productScrollPane.setViewportView(productList);
- productList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.productList.AccessibleContext.accessibleDescription")); // NOI18N
-
- severityLabel.setFont(severityLabel.getFont().deriveFont(severityLabel.getFont().getStyle() | java.awt.Font.BOLD));
- severityLabel.setLabelFor(severityList);
- org.openide.awt.Mnemonics.setLocalizedText(severityLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.severityLabel.text")); // NOI18N
-
- severityScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- severityList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- severityList.setVisibleRowCount(6);
- severityScrollPane.setViewportView(severityList);
- severityList.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.severityList.AccessibleContext.accessibleDescription")); // NOI18N
-
- issueTypeLabel.setFont(issueTypeLabel.getFont().deriveFont(issueTypeLabel.getFont().getStyle() | java.awt.Font.BOLD));
- issueTypeLabel.setLabelFor(severityList);
- org.openide.awt.Mnemonics.setLocalizedText(issueTypeLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.issueTypeLabel.text")); // NOI18N
-
- issueTypeScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- issueTypeList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- issueTypeList.setVisibleRowCount(6);
- issueTypeScrollPane.setViewportView(issueTypeList);
-
- tmLabel.setFont(tmLabel.getFont().deriveFont(tmLabel.getFont().getStyle() | java.awt.Font.BOLD));
- tmLabel.setLabelFor(severityList);
- org.openide.awt.Mnemonics.setLocalizedText(tmLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.tmLabel.text")); // NOI18N
-
- tmScrollPane.setHorizontalScrollBarPolicy(javax.swing.ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
-
- tmList.setModel(new javax.swing.AbstractListModel() {
- String[] strings = { "" };
- public int getSize() { return strings.length; }
- public Object getElementAt(int i) { return strings[i]; }
- });
- tmList.setVisibleRowCount(6);
- tmScrollPane.setViewportView(tmList);
-
- javax.swing.GroupLayout byDetailsPanelLayout = new javax.swing.GroupLayout(byDetailsPanel);
- byDetailsPanel.setLayout(byDetailsPanelLayout);
- byDetailsPanelLayout.setHorizontalGroup(
- byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byDetailsPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(productLabel)
- .addComponent(productScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(componentLabel)
- .addComponent(componentScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(versionLabel)
- .addComponent(versionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(18, 18, 18)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(statusLabel)
- .addComponent(statusScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(resolutionLabel)
- .addComponent(resolutionScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
- .addComponent(priorityScrollPane)
- .addComponent(priorityLabel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(severityLabel)
- .addComponent(severityScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(issueTypeLabel)
- .addComponent(issueTypeScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(tmLabel)
- .addComponent(tmScrollPane, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- byDetailsPanelLayout.setVerticalGroup(
- byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byDetailsPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byDetailsPanelLayout.createSequentialGroup()
- .addComponent(tmLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tmScrollPane))
- .addGroup(byDetailsPanelLayout.createSequentialGroup()
- .addComponent(issueTypeLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(issueTypeScrollPane))
- .addGroup(byDetailsPanelLayout.createSequentialGroup()
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(productLabel)
- .addComponent(componentLabel)
- .addComponent(versionLabel)
- .addComponent(statusLabel)
- .addComponent(resolutionLabel)
- .addComponent(priorityLabel)
- .addComponent(severityLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byDetailsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(priorityScrollPane)
- .addComponent(productScrollPane)
- .addComponent(componentScrollPane)
- .addComponent(versionScrollPane)
- .addComponent(statusScrollPane)
- .addComponent(resolutionScrollPane)
- .addComponent(severityScrollPane))))
- .addContainerGap())
- );
-
- byTextPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- summaryLabel.setLabelFor(summaryComboBox);
- org.openide.awt.Mnemonics.setLocalizedText(summaryLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryLabel.text_1")); // NOI18N
-
- commentLabel.setLabelFor(commentComboBox);
- org.openide.awt.Mnemonics.setLocalizedText(commentLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentLabel.text")); // NOI18N
-
- keywordsLabel.setLabelFor(keywordsComboBox);
- org.openide.awt.Mnemonics.setLocalizedText(keywordsLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsLabel.text")); // NOI18N
-
- summaryComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- commentComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- keywordsComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- summaryTextField.setColumns(30);
-
- commentTextField.setColumns(30);
-
- keywordsTextField.setColumns(30);
-
- org.openide.awt.Mnemonics.setLocalizedText(keywordsButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsButton.text")); // NOI18N
- keywordsButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- keywordsButtonActionPerformed(evt);
- }
- });
-
- whiteboardLabel.setLabelFor(commentComboBox);
- org.openide.awt.Mnemonics.setLocalizedText(whiteboardLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.whiteboardLabel.text")); // NOI18N
-
- whiteboardComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- whiteboardTextField.setColumns(30);
-
- javax.swing.GroupLayout byTextPanelLayout = new javax.swing.GroupLayout(byTextPanel);
- byTextPanel.setLayout(byTextPanelLayout);
- byTextPanelLayout.setHorizontalGroup(
- byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byTextPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(summaryLabel)
- .addComponent(commentLabel)
- .addComponent(whiteboardLabel)
- .addComponent(keywordsLabel))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(commentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(summaryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(whiteboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(keywordsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(commentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
- .addComponent(summaryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE)
- .addGroup(byTextPanelLayout.createSequentialGroup()
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(keywordsTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 82, Short.MAX_VALUE)
- .addComponent(whiteboardTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 1, Short.MAX_VALUE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(keywordsButton)))
- .addContainerGap())
- );
- byTextPanelLayout.setVerticalGroup(
- byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(byTextPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(summaryLabel)
- .addComponent(summaryComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(summaryTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(commentLabel)
- .addComponent(commentTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(commentComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(whiteboardLabel)
- .addComponent(whiteboardTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(whiteboardComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addGroup(byTextPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(keywordsLabel)
- .addComponent(keywordsComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(keywordsTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(keywordsButton))
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
-
- summaryComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryComboBox.AccessibleContext.accessibleDescription")); // NOI18N
- commentComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentComboBox.AccessibleContext.accessibleDescription")); // NOI18N
- keywordsComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsComboBox.AccessibleContext.accessibleDescription")); // NOI18N
- summaryTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryTextField.AccessibleContext.accessibleName")); // NOI18N
- summaryTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.summaryTextField.AccessibleContext.accessibleDescription")); // NOI18N
- commentTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentTextField.AccessibleContext.accessibleName")); // NOI18N
- commentTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.commentTextField.AccessibleContext.accessibleDescription")); // NOI18N
- keywordsTextField.getAccessibleContext().setAccessibleName(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsTextField.AccessibleContext.accessibleName")); // NOI18N
- keywordsTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsTextField.AccessibleContext.accessibleDescription")); // NOI18N
- keywordsButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.keywordsButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- tableFieldsPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- tablePanel.setBackground(new java.awt.Color(224, 224, 224));
- tablePanel.setBorder(javax.swing.BorderFactory.createEtchedBorder());
- tablePanel.setMinimumSize(new java.awt.Dimension(100, 350));
- tablePanel.setLayout(new java.awt.BorderLayout());
-
- tableHeaderPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- org.openide.awt.Mnemonics.setLocalizedText(tableSummaryLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.tableSummaryLabel.text_1")); // NOI18N
-
- filterComboBox.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
-
- filterLabel.setLabelFor(filterComboBox);
- org.openide.awt.Mnemonics.setLocalizedText(filterLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.filterLabel.text_1")); // NOI18N
-
- javax.swing.GroupLayout tableHeaderPanelLayout = new javax.swing.GroupLayout(tableHeaderPanel);
- tableHeaderPanel.setLayout(tableHeaderPanelLayout);
- tableHeaderPanelLayout.setHorizontalGroup(
- tableHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(tableHeaderPanelLayout.createSequentialGroup()
- .addComponent(tableSummaryLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(filterLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(filterComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
- tableHeaderPanelLayout.setVerticalGroup(
- tableHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(tableHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(tableSummaryLabel)
- .addComponent(filterComboBox, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(filterLabel))
- );
-
- filterComboBox.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.filterComboBox.AccessibleContext.accessibleDescription")); // NOI18N
-
- javax.swing.GroupLayout tableFieldsPanelLayout = new javax.swing.GroupLayout(tableFieldsPanel);
- tableFieldsPanel.setLayout(tableFieldsPanelLayout);
- tableFieldsPanelLayout.setHorizontalGroup(
- tableFieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(tableFieldsPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(tableFieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(tablePanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(tableHeaderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
- );
- tableFieldsPanelLayout.setVerticalGroup(
- tableFieldsPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(tableFieldsPanelLayout.createSequentialGroup()
- .addComponent(tableHeaderPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tablePanel, javax.swing.GroupLayout.DEFAULT_SIZE, 350, Short.MAX_VALUE)
- .addContainerGap())
- );
-
- searchPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- org.openide.awt.Mnemonics.setLocalizedText(webButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.webButton.text")); // NOI18N
- webButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- webButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(urlToggleButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.textUrl")); // NOI18N
- urlToggleButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- urlToggleButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(searchButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.searchButton.text")); // NOI18N
-
- criteriaPanel.setBackground(new java.awt.Color(224, 224, 224));
-
- byTextLabel.setFont(byTextLabel.getFont().deriveFont(byTextLabel.getFont().getStyle() | java.awt.Font.BOLD));
- org.openide.awt.Mnemonics.setLocalizedText(byTextLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byTextLabel.text_1")); // NOI18N
-
- byTextContainer.setLayout(new java.awt.BorderLayout());
-
- byDetailsContainer.setLayout(new java.awt.BorderLayout());
-
- byDetailsLabel.setFont(byDetailsLabel.getFont().deriveFont(byDetailsLabel.getFont().getStyle() | java.awt.Font.BOLD));
- org.openide.awt.Mnemonics.setLocalizedText(byDetailsLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byDetailsLabel.text")); // NOI18N
-
- byPeopleLabel.setFont(byPeopleLabel.getFont().deriveFont(byPeopleLabel.getFont().getStyle() | java.awt.Font.BOLD));
- org.openide.awt.Mnemonics.setLocalizedText(byPeopleLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byPeopleLabel.text")); // NOI18N
-
- byPeopleContainer.setLayout(new java.awt.BorderLayout());
-
- byLastChangeLabel.setFont(byLastChangeLabel.getFont().deriveFont(byLastChangeLabel.getFont().getStyle() | java.awt.Font.BOLD));
- org.openide.awt.Mnemonics.setLocalizedText(byLastChangeLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.byLastChangeLabel.text")); // NOI18N
-
- byLastChangeContainer.setLayout(new java.awt.BorderLayout());
-
- urlPanel.setBackground(new java.awt.Color(224, 224, 224));
-
- jLabel2.setLabelFor(urlTextField);
- org.openide.awt.Mnemonics.setLocalizedText(jLabel2, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel2.text_1")); // NOI18N
-
- urlTextField.setColumns(50);
-
- javax.swing.GroupLayout urlPanelLayout = new javax.swing.GroupLayout(urlPanel);
- urlPanel.setLayout(urlPanelLayout);
- urlPanelLayout.setHorizontalGroup(
- urlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(urlPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel2)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(urlTextField)
- .addContainerGap())
- );
- urlPanelLayout.setVerticalGroup(
- urlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(urlPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(urlTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel2))
- );
-
- urlTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlTextField.AccessibleContext.accessibleDescription")); // NOI18N
-
- javax.swing.GroupLayout criteriaPanelLayout = new javax.swing.GroupLayout(criteriaPanel);
- criteriaPanel.setLayout(criteriaPanelLayout);
- criteriaPanelLayout.setHorizontalGroup(
- criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(urlPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(byDetailsContainer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(criteriaPanelLayout.createSequentialGroup()
- .addGroup(criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(byLastChangeContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGroup(criteriaPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(byTextLabel)
- .addComponent(byDetailsLabel)
- .addComponent(byPeopleLabel)
- .addComponent(byLastChangeLabel)))
- .addComponent(byTextContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(byPeopleContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addGap(0, 0, Short.MAX_VALUE))
- );
- criteriaPanelLayout.setVerticalGroup(
- criteriaPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(criteriaPanelLayout.createSequentialGroup()
- .addComponent(byTextLabel)
- .addGap(0, 0, 0)
- .addComponent(byTextContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)
- .addComponent(byDetailsLabel)
- .addGap(0, 0, 0)
- .addComponent(byDetailsContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0)
- .addComponent(byPeopleLabel)
- .addGap(0, 0, 0)
- .addComponent(byPeopleContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0)
- .addComponent(byLastChangeLabel)
- .addGap(0, 0, 0)
- .addComponent(byLastChangeContainer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, 0)
- .addComponent(urlPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
-
- org.openide.awt.Mnemonics.setLocalizedText(cancelChangesButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.cancelChangesButton.text")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(saveChangesButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.saveChangesButton.text")); // NOI18N
-
- gotoPanel.setBackground(new java.awt.Color(224, 224, 224));
-
- jLabel1.setLabelFor(idTextField);
- org.openide.awt.Mnemonics.setLocalizedText(jLabel1, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel1.text_1")); // NOI18N
-
- idTextField.setColumns(6);
-
- org.openide.awt.Mnemonics.setLocalizedText(gotoIssueButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.gotoIssueButton.text")); // NOI18N
-
- javax.swing.GroupLayout gotoPanelLayout = new javax.swing.GroupLayout(gotoPanel);
- gotoPanel.setLayout(gotoPanelLayout);
- gotoPanelLayout.setHorizontalGroup(
- gotoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(gotoPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(jLabel1)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(gotoIssueButton)
- .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
- );
- gotoPanelLayout.setVerticalGroup(
- gotoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(gotoPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(gotoIssueButton)
- .addComponent(jLabel1)
- .addComponent(idTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- );
-
- idTextField.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.idTextField.AccessibleContext.accessibleDescription")); // NOI18N
- gotoIssueButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.gotoIssueButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(separatorLabel2, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.separatorLabel2.text")); // NOI18N
- separatorLabel2.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- org.openide.awt.Mnemonics.setLocalizedText(refreshConfigurationButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshConfigurationButton.text")); // NOI18N
- refreshConfigurationButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- refreshConfigurationButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(separatorLabel3, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.separatorLabel3.text")); // NOI18N
- separatorLabel3.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- javax.swing.GroupLayout searchPanelLayout = new javax.swing.GroupLayout(searchPanel);
- searchPanel.setLayout(searchPanelLayout);
- searchPanelLayout.setHorizontalGroup(
- searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(gotoPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, searchPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addComponent(searchButton)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(saveChangesButton)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(cancelChangesButton)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 496, Short.MAX_VALUE)
- .addComponent(webButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(separatorLabel2)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(urlToggleButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(separatorLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(refreshConfigurationButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addContainerGap())
- .addComponent(criteriaPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- searchPanelLayout.setVerticalGroup(
- searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(searchPanelLayout.createSequentialGroup()
- .addComponent(gotoPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(criteriaPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 8, Short.MAX_VALUE)
- .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(searchButton)
- .addComponent(cancelChangesButton)
- .addComponent(saveChangesButton))
- .addGroup(searchPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(refreshConfigurationButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(urlToggleButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(webButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(separatorLabel2)
- .addComponent(separatorLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 18, javax.swing.GroupLayout.PREFERRED_SIZE)))
- .addContainerGap())
- );
-
- searchPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {separatorLabel2, urlToggleButton, webButton});
-
- webButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.webButton.AccessibleContext.accessibleDescription")); // NOI18N
- urlToggleButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.AccessibleContext.accessibleDescription")); // NOI18N
- searchButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.searchButton.AccessibleContext.accessibleDescription")); // NOI18N
- cancelChangesButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.cancelChangesButton.AccessibleContext.accessibleDescription")); // NOI18N
- saveChangesButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.saveChangesButton.AccessibleContext.accessibleDescription")); // NOI18N
- refreshConfigurationButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshConfigurationButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- queryHeaderPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
-
- org.openide.awt.Mnemonics.setLocalizedText(seenButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.seenButton.text")); // NOI18N
- seenButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- seenButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(lastRefreshLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.lastRefreshLabel.text_1")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(removeButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.removeButton.text")); // NOI18N
- removeButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- removeButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(lastRefreshDateLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.lastRefreshDateLabel.text_1")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(refreshButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshButton.text")); // NOI18N
- refreshButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- refreshButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(nameLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.nameLabel.text_1")); // NOI18N
-
- org.openide.awt.Mnemonics.setLocalizedText(modifyButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.modifyButton.text")); // NOI18N
- modifyButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- modifyButtonActionPerformed(evt);
- }
- });
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel4, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel4.text_1")); // NOI18N
- jLabel4.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel5, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel5.text")); // NOI18N
- jLabel5.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel6, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel6.text")); // NOI18N
- jLabel6.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- org.openide.awt.Mnemonics.setLocalizedText(jLabel7, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.jLabel7.text")); // NOI18N
- jLabel7.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));
-
- org.openide.awt.Mnemonics.setLocalizedText(cloneQueryButton, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.cloneQueryButton.text")); // NOI18N
- cloneQueryButton.addActionListener(new java.awt.event.ActionListener() {
- public void actionPerformed(java.awt.event.ActionEvent evt) {
- cloneQueryButtonActionPerformed(evt);
- }
- });
-
- javax.swing.GroupLayout queryHeaderPanelLayout = new javax.swing.GroupLayout(queryHeaderPanel);
- queryHeaderPanel.setLayout(queryHeaderPanelLayout);
- queryHeaderPanelLayout.setHorizontalGroup(
- queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(queryHeaderPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(queryHeaderPanelLayout.createSequentialGroup()
- .addComponent(nameLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(lastRefreshLabel)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(lastRefreshDateLabel))
- .addGroup(queryHeaderPanelLayout.createSequentialGroup()
- .addComponent(seenButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
- .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(7, 7, 7)
- .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 2, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(5, 5, 5)
- .addComponent(jLabel6)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(jLabel7)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(cloneQueryButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addGap(0, 0, Short.MAX_VALUE)))
- .addContainerGap())
- );
- queryHeaderPanelLayout.setVerticalGroup(
- queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(queryHeaderPanelLayout.createSequentialGroup()
- .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(queryHeaderPanelLayout.createSequentialGroup()
- .addGap(11, 11, 11)
- .addComponent(nameLabel))
- .addGroup(queryHeaderPanelLayout.createSequentialGroup()
- .addContainerGap()
- .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
- .addComponent(lastRefreshDateLabel)
- .addComponent(lastRefreshLabel))))
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 12, Short.MAX_VALUE)
- .addGroup(queryHeaderPanelLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.CENTER)
- .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel5, javax.swing.GroupLayout.PREFERRED_SIZE, 11, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel6)
- .addComponent(modifyButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(refreshButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(removeButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(seenButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addComponent(jLabel7)
- .addComponent(cloneQueryButton, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
- .addContainerGap())
- );
-
- queryHeaderPanelLayout.linkSize(javax.swing.SwingConstants.VERTICAL, new java.awt.Component[] {jLabel4, jLabel5, jLabel6, jLabel7, modifyButton, refreshButton, removeButton});
-
- seenButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.refreshButton.AccessibleContext.accessibleDescription")); // NOI18N
- removeButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.removeButton.AccessibleContext.accessibleDescription")); // NOI18N
- refreshButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.seenButton.AccessibleContext.accessibleDescription")); // NOI18N
- modifyButton.getAccessibleContext().setAccessibleDescription(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.modifyButton.AccessibleContext.accessibleDescription")); // NOI18N
-
- noContentPanel.setBackground(javax.swing.UIManager.getDefaults().getColor("TextArea.background"));
- noContentPanel.setLayout(new java.awt.GridBagLayout());
-
- org.openide.awt.Mnemonics.setLocalizedText(noContentLabel, org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.noContentLabel.text")); // NOI18N
- noContentPanel.add(noContentLabel, new java.awt.GridBagConstraints());
-
- javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
- this.setLayout(layout);
- layout.setHorizontalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addComponent(queryHeaderPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addComponent(searchPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addGroup(layout.createSequentialGroup()
- .addComponent(tableFieldsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addContainerGap())
- .addComponent(noContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- );
- layout.setVerticalGroup(
- layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
- .addGroup(layout.createSequentialGroup()
- .addComponent(queryHeaderPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(searchPanel, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(tableFieldsPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
- .addComponent(noContentPanel, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
- .addContainerGap())
- );
- }// //GEN-END:initComponents
-
- private void seenButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_seenButtonActionPerformed
- // TODO add your handling code here:
-}//GEN-LAST:event_seenButtonActionPerformed
-
- private void modifyButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_modifyButtonActionPerformed
- // TODO add your handling code here:
-}//GEN-LAST:event_modifyButtonActionPerformed
-
- private void refreshButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshButtonActionPerformed
- // TODO add your handling code here:
-}//GEN-LAST:event_refreshButtonActionPerformed
-
- private void removeButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_removeButtonActionPerformed
- // TODO add your handling code here:
-}//GEN-LAST:event_removeButtonActionPerformed
-
- private void webButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_webButtonActionPerformed
- // TODO add your handling code here:
-}//GEN-LAST:event_webButtonActionPerformed
-
- private void urlToggleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_urlToggleButtonActionPerformed
- // TODO add your handling code here:
-}//GEN-LAST:event_urlToggleButtonActionPerformed
-
- private void keywordsButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_keywordsButtonActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_keywordsButtonActionPerformed
-
- private void reporterCheckBoxActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_reporterCheckBoxActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_reporterCheckBoxActionPerformed
-
- private void refreshConfigurationButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_refreshConfigurationButtonActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_refreshConfigurationButtonActionPerformed
-
- private void cloneQueryButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_cloneQueryButtonActionPerformed
- // TODO add your handling code here:
- }//GEN-LAST:event_cloneQueryButtonActionPerformed
-
-
- // Variables declaration - do not modify//GEN-BEGIN:variables
- final javax.swing.JCheckBox bugAssigneeCheckBox = new javax.swing.JCheckBox();
- final javax.swing.JPanel byDetailsContainer = new javax.swing.JPanel();
- final javax.swing.JLabel byDetailsLabel = new javax.swing.JLabel();
- final javax.swing.JPanel byDetailsPanel = new javax.swing.JPanel();
- final javax.swing.JPanel byLastChangeContainer = new javax.swing.JPanel();
- final javax.swing.JLabel byLastChangeLabel = new javax.swing.JLabel();
- private javax.swing.JPanel byLastChangePanel;
- final javax.swing.JPanel byPeopleContainer = new javax.swing.JPanel();
- final javax.swing.JLabel byPeopleLabel = new javax.swing.JLabel();
- private javax.swing.JPanel byPeoplePanel;
- final javax.swing.JPanel byTextContainer = new javax.swing.JPanel();
- final javax.swing.JLabel byTextLabel = new javax.swing.JLabel();
- private javax.swing.JPanel byTextPanel;
- final javax.swing.JButton cancelChangesButton = new javax.swing.JButton();
- final javax.swing.JCheckBox ccCheckBox = new javax.swing.JCheckBox();
- private javax.swing.JLabel changedAndLabel;
- private javax.swing.JLabel changedBlaBlaLabel;
- final javax.swing.JTextField changedFromTextField = new javax.swing.JTextField();
- private javax.swing.JLabel changedHintLabel;
- private javax.swing.JLabel changedLabel;
- final javax.swing.JList changedList = new javax.swing.JList();
- final javax.swing.JTextField changedToTextField = new javax.swing.JTextField();
- private javax.swing.JLabel changedWhereLabel;
- public final org.netbeans.modules.bugtracking.commons.LinkButton cloneQueryButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- final javax.swing.JComboBox commentComboBox = new javax.swing.JComboBox();
- final javax.swing.JLabel commentLabel = new javax.swing.JLabel();
- final javax.swing.JTextField commentTextField = new javax.swing.JTextField();
- final javax.swing.JCheckBox commenterCheckBox = new javax.swing.JCheckBox();
- final javax.swing.JLabel componentLabel = new javax.swing.JLabel();
- final javax.swing.JList componentList = new javax.swing.JList();
- final javax.swing.JScrollPane componentScrollPane = new HackedScrollPane();
- private javax.swing.JPanel criteriaPanel;
- final javax.swing.JComboBox filterComboBox = new javax.swing.JComboBox();
- private javax.swing.JLabel filterLabel;
- final javax.swing.JButton gotoIssueButton = new javax.swing.JButton();
- final javax.swing.JPanel gotoPanel = new javax.swing.JPanel();
- final javax.swing.JTextField idTextField = new javax.swing.JTextField();
- final javax.swing.JLabel issueTypeLabel = new javax.swing.JLabel();
- final javax.swing.JList issueTypeList = new javax.swing.JList();
- final javax.swing.JScrollPane issueTypeScrollPane = new HackedScrollPane();
- private javax.swing.JLabel jLabel1;
- private javax.swing.JLabel jLabel2;
- private javax.swing.JLabel jLabel4;
- private javax.swing.JLabel jLabel5;
- private javax.swing.JLabel jLabel6;
- private javax.swing.JLabel jLabel7;
- private javax.swing.JScrollPane jScrollPane1;
- final javax.swing.JButton keywordsButton = new javax.swing.JButton();
- final javax.swing.JComboBox keywordsComboBox = new javax.swing.JComboBox();
- final javax.swing.JLabel keywordsLabel = new javax.swing.JLabel();
- final javax.swing.JTextField keywordsTextField = new javax.swing.JTextField();
- final javax.swing.JLabel lastRefreshDateLabel = new javax.swing.JLabel();
- private javax.swing.JLabel lastRefreshLabel;
- public final org.netbeans.modules.bugtracking.commons.LinkButton modifyButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- final javax.swing.JLabel nameLabel = new javax.swing.JLabel();
- final javax.swing.JTextField newValueTextField = new javax.swing.JTextField();
- private javax.swing.JLabel noContentLabel;
- private javax.swing.JPanel noContentPanel;
- final javax.swing.JComboBox peopleComboBox = new javax.swing.JComboBox();
- final javax.swing.JLabel peopleLabel = new javax.swing.JLabel();
- final javax.swing.JTextField peopleTextField = new javax.swing.JTextField();
- final javax.swing.JLabel priorityLabel = new javax.swing.JLabel();
- final javax.swing.JList priorityList = new javax.swing.JList();
- final javax.swing.JScrollPane priorityScrollPane = new HackedScrollPane();
- final javax.swing.JLabel productLabel = new javax.swing.JLabel();
- final javax.swing.JList productList = new javax.swing.JList();
- final javax.swing.JScrollPane productScrollPane = new javax.swing.JScrollPane();
- private javax.swing.JPanel queryHeaderPanel;
- final org.netbeans.modules.bugtracking.commons.LinkButton refreshButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- final org.netbeans.modules.bugtracking.commons.LinkButton refreshConfigurationButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- public final org.netbeans.modules.bugtracking.commons.LinkButton removeButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- final javax.swing.JCheckBox reporterCheckBox = new javax.swing.JCheckBox();
- final javax.swing.JLabel resolutionLabel = new javax.swing.JLabel();
- final javax.swing.JList resolutionList = new javax.swing.JList();
- final javax.swing.JScrollPane resolutionScrollPane = new HackedScrollPane();
- final javax.swing.JButton saveChangesButton = new javax.swing.JButton();
- final javax.swing.JButton searchButton = new javax.swing.JButton();
- final javax.swing.JPanel searchPanel = new javax.swing.JPanel();
- final org.netbeans.modules.bugtracking.commons.LinkButton seenButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- private javax.swing.JLabel separatorLabel2;
- private javax.swing.JLabel separatorLabel3;
- final javax.swing.JLabel severityLabel = new javax.swing.JLabel();
- final javax.swing.JList severityList = new javax.swing.JList();
- final javax.swing.JScrollPane severityScrollPane = new HackedScrollPane();
- final javax.swing.JLabel statusLabel = new javax.swing.JLabel();
- final javax.swing.JList statusList = new javax.swing.JList();
- final javax.swing.JScrollPane statusScrollPane = new HackedScrollPane();
- final javax.swing.JComboBox summaryComboBox = new javax.swing.JComboBox();
- final javax.swing.JLabel summaryLabel = new javax.swing.JLabel();
- final javax.swing.JTextField summaryTextField = new javax.swing.JTextField();
- private javax.swing.JPanel tableFieldsPanel;
- private javax.swing.JPanel tableHeaderPanel;
- final javax.swing.JPanel tablePanel = new javax.swing.JPanel();
- final javax.swing.JLabel tableSummaryLabel = new javax.swing.JLabel();
- final javax.swing.JLabel tmLabel = new javax.swing.JLabel();
- final javax.swing.JList tmList = new javax.swing.JList();
- final javax.swing.JScrollPane tmScrollPane = new HackedScrollPane();
- final javax.swing.JPanel urlPanel = new javax.swing.JPanel();
- final javax.swing.JTextField urlTextField = new javax.swing.JTextField();
- final org.netbeans.modules.bugtracking.commons.LinkButton urlToggleButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- final javax.swing.JLabel versionLabel = new javax.swing.JLabel();
- final javax.swing.JList versionList = new javax.swing.JList();
- final javax.swing.JScrollPane versionScrollPane = new HackedScrollPane();
- final org.netbeans.modules.bugtracking.commons.LinkButton webButton = new org.netbeans.modules.bugtracking.commons.LinkButton();
- final javax.swing.JComboBox whiteboardComboBox = new javax.swing.JComboBox();
- final javax.swing.JLabel whiteboardLabel = new javax.swing.JLabel();
- final javax.swing.JTextField whiteboardTextField = new javax.swing.JTextField();
- // End of variables declaration//GEN-END:variables
-
- /**
- * enables/disables all but the parameter fields
- * @param enable
- */
- void enableFields(final boolean enable) {
-
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- summaryLabel.setEnabled(enable);
- whiteboardLabel.setEnabled(enable);
- commentLabel.setEnabled(enable);
- keywordsLabel.setEnabled(enable);
- keywordsButton.setEnabled(enable);
-
- productLabel.setEnabled(enable);
- componentLabel.setEnabled(enable);
- versionLabel.setEnabled(enable);
- statusLabel.setEnabled(enable);
- severityLabel.setEnabled(enable);
- resolutionLabel.setEnabled(enable);
- priorityLabel.setEnabled(enable);
- tmLabel.setEnabled(enable);
- issueTypeLabel.setEnabled(enable);
-
- peopleLabel.setEnabled(enable);
- peopleTextField.setEnabled(enable);
-
- searchButton.setEnabled(enable);
- webButton.setEnabled(enable);
- urlToggleButton.setEnabled(enable);
- refreshConfigurationButton.setEnabled(enable);
-
- changedLabel.setEnabled(enable);
- changedAndLabel.setEnabled(enable);
- changedWhereLabel.setEnabled(enable);
- changedBlaBlaLabel.setEnabled(enable);
- changedHintLabel.setEnabled(enable);
- }
- });
- }
-
- void switchQueryFields(final boolean showAdvanced) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- byDetails.setVisible(showAdvanced);
- byText.setVisible(showAdvanced);
- byLastChange.setVisible(showAdvanced);
- byPeople.setVisible(showAdvanced);
-
- urlPanel.setVisible(!showAdvanced);
- if (showAdvanced) {
- urlToggleButton.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.textUrl"));
- } else {
- urlToggleButton.setText(org.openide.util.NbBundle.getMessage(QueryPanel.class, "QueryPanel.urlToggleButton.textForm"));
- }
- }
- });
- }
-
- void showError(final String text) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- noContentPanel.setVisible(true);
- tableSummaryLabel.setVisible(false);
- tableFieldsPanel.setVisible(false);
- if (text != null) {
- noContentLabel.setForeground(BugzillaUtil.getErrorForegroundColor());
- noContentLabel.setText(text);
- }
- }
- });
- }
-
- void showSearchingProgress(final boolean on, final String text) {
- UIUtils.runInAWT(new Runnable() {
- public void run() {
- noContentPanel.setVisible(on);
- tableSummaryLabel.setVisible(!on);
- tableFieldsPanel.setVisible(!on);
- if (on && text != null) {
- noContentLabel.setForeground(defaultTextColor);
- noContentLabel.setText(text);
- }
- }
- });
- }
-
- void showRetrievingProgress(final boolean on, final String text, final boolean searchPanelVisible) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- noContentPanel.setVisible(on);
- noContentLabel.setForeground(Color.red);
- if (searchPanelVisible) {
- searchPanel.setVisible(!on);
- }
- if (on && text != null) {
- noContentLabel.setForeground(defaultTextColor);
- noContentLabel.setText(text);
- }
- }
- });
- }
-
- void showNoContentPanel(boolean on) {
- showSearchingProgress(on, null);
- }
-
- void setModifyVisible(final boolean b) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- searchPanel.setVisible(b);
- cancelChangesButton.setVisible(b);
- saveChangesButton.setVisible(b);
-
- webButton.setVisible(b);
- separatorLabel2.setVisible(b);
-
- tableFieldsPanel.setVisible(!b);
- searchButton.setVisible(!b);
- urlToggleButton.setVisible(!b);
-
- separatorLabel3.setVisible(!b);
- }
- });
- }
-
- void setSaved(final String name, final String lastRefresh) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- searchPanel.setVisible(false);
- gotoPanel.setVisible(false);
- queryHeaderPanel.setVisible(true);
- tableHeaderPanel.setVisible(true);
- filterComboBox.setVisible(true); // XXX move to bugtracking IssueTable component
- filterLabel.setVisible(true);
- tablePanel.setVisible(true);
- nameLabel.setText(name);
- setLastRefresh(lastRefresh);
- }
- });
- }
-
- void setLastRefresh(final String lastRefresh) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- lastRefreshDateLabel.setText(lastRefresh);
- }
- });
- }
-
- void setNBFieldsVisible(final boolean visible) {
- UIUtils.runInAWT(new Runnable() {
- @Override
- public void run() {
- whiteboardLabel.setVisible(visible);
- whiteboardComboBox.setVisible(visible);
- whiteboardTextField.setVisible(visible);
-
- issueTypeLabel.setVisible(visible);
- issueTypeList.setVisible(visible);
- issueTypeScrollPane.setVisible(visible);
- severityLabel.setVisible(!visible);
- severityList.setVisible(!visible);
- severityScrollPane.setVisible(!visible);
- }
- });
- }
-
- public void focusLost(FocusEvent e) {
- // do nothing
- }
-
- class ExpandablePanel {
- private final JPanel panel;
- private final JLabel label;
- private final Icon ei;
- private final Icon ci;
- private boolean expaned = true;
- public ExpandablePanel(JLabel l, JPanel p, final Icon ei, final Icon ci) {
- this.panel = p;
- this.label = l;
- this.ci = ci;
- this.ei = ei;
- this.label.addMouseListener(new MouseAdapter() {
- @Override
- public void mouseClicked(MouseEvent e) {
- if(panel.isVisible()) {
- colapse();
- } else {
- expand();
- }
- }
- });
- }
- public void expand() {
- expaned = true;
- panel.setVisible(true);
- label.setIcon(ei);
- }
- public void colapse() {
- expaned = false;
- panel.setVisible(false);
- label.setIcon(ci);
- }
- public void setVisible(boolean visible ) {
- label.setVisible(visible);
- panel.setVisible(visible && expaned);
- }
- }
-
- private static class FilterCellRenderer extends DefaultListCellRenderer {
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- if(value instanceof Filter) {
- value = ((Filter)value).getDisplayName();
- }
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- }
-
- static class HackedScrollPane extends JScrollPane {
- @Override
- public Dimension getPreferredSize() {
- setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
- Dimension dim = super.getPreferredSize();
- setVerticalScrollBarPolicy(JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED);
- return dim;
- }
- }
-
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java
deleted file mode 100644
index 95e6f9c340ac..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/query/QueryParameter.java
+++ /dev/null
@@ -1,675 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.query;
-
-import java.awt.Component;
-import java.awt.event.ActionEvent;
-import java.awt.event.ActionListener;
-import java.awt.event.ItemEvent;
-import java.awt.event.ItemListener;
-import java.io.UnsupportedEncodingException;
-import java.net.URLEncoder;
-import java.util.Arrays;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.logging.Level;
-import javax.swing.DefaultComboBoxModel;
-import javax.swing.DefaultListCellRenderer;
-import javax.swing.DefaultListModel;
-import javax.swing.JCheckBox;
-import javax.swing.JComboBox;
-import javax.swing.JLabel;
-import javax.swing.JList;
-import javax.swing.JTextField;
-import javax.swing.ListModel;
-import javax.swing.event.ChangeListener;
-import javax.swing.event.DocumentEvent;
-import javax.swing.event.DocumentListener;
-import javax.swing.event.ListSelectionEvent;
-import javax.swing.event.ListSelectionListener;
-import org.netbeans.modules.bugzilla.Bugzilla;
-import org.netbeans.modules.bugzilla.BugzillaConfig;
-import org.openide.util.ChangeSupport;
-
-/**
- *
- * @author Tomas Stupka
- */
-public abstract class QueryParameter {
- static final ParameterValue[] EMPTY_PARAMETER_VALUE = new ParameterValue[] {new ParameterValue("", "")}; // NOI18N
-
- static final ParameterValue PV_CONTAINS_ALL_KEYWORDS = new ParameterValue("contains all keywords", "allwords"); // NOI18N
- static final ParameterValue PV_CONTAINS_ANY_KEYWORDS = new ParameterValue("contains any keywords", "anywords"); // NOI18N
- static final ParameterValue PV_CONTAINS_NONE_KEYWORDS = new ParameterValue("contains none keywords", "nowords"); // NOI18N
-
- static final ParameterValue PV_CONTAINS = new ParameterValue("contains", "substring"); // NOI18N
- static final ParameterValue PV_IS = new ParameterValue("is", "exact"); // NOI18N
- static final ParameterValue PV_MATCHES_REGEX = new ParameterValue("matches the regexp", "regexp"); // NOI18N
- static final ParameterValue PV_DOESNT_MATCH_REGEX = new ParameterValue("doesn't match the regexp", "notregexp"); // NOI18N
-
- static final ParameterValue PV_CONTAINS_ALL_STRINGS = new ParameterValue("contains all of the words/strings", "allwordssubstr"); // NOI18N
- static final ParameterValue PV_CONTAINS_ANY_STRINGS = new ParameterValue("contains any of the words/strings", "anywordssubstr"); // NOI18N
- static final ParameterValue PV_CONTAINS_THE_STRING = new ParameterValue("contains the string", "substring"); // NOI18N
- static final ParameterValue PV_CONTAINS_THE_STRING_CASE = new ParameterValue("contains the string (exact case)", "casesubstring"); // NOI18N
- static final ParameterValue PV_CONTAINS_ALL_WORDS = new ParameterValue("contains all of the words", "allwords"); // NOI18N
- static final ParameterValue PV_CONTAINS_ANY_WORDS = new ParameterValue("contains any of the words", "anywords"); // NOI18N
-
- static final ParameterValue PV_FIELD_BUG_CREATION = new ParameterValue("[Bug creation]", "[Bug+creation]"); // NOI18N
- static final ParameterValue PV_FIELD_ALIAS = new ParameterValue("alias", "alias"); // NOI18N
- static final ParameterValue PV_FIELD_ASSIGNED_TO = new ParameterValue("assigned_to", "assigned_to"); // NOI18N
- static final ParameterValue PV_FIELD_LIST_ACCESSIBLE = new ParameterValue("cclist_accessible", "cclist_accessible"); // NOI18N
- static final ParameterValue PV_FIELD_COMPONENT = new ParameterValue("component", "component"); // NOI18N
- static final ParameterValue PV_FIELD_DEADLINE = new ParameterValue("deadline", "deadline"); // NOI18N
- static final ParameterValue PV_FIELD_EVER_CONFIRMED = new ParameterValue("everconfirmed", "everconfirmed"); // NOI18N
- static final ParameterValue PV_FIELD_REP_PLARFORM = new ParameterValue("rep_platform", "rep_platform"); // NOI18N
- static final ParameterValue PV_FIELD_REMAINING_TIME = new ParameterValue("remaining_time", "remaining_time"); // NOI18N
- static final ParameterValue PV_FIELD_WORK_TIME = new ParameterValue("work_time", "work_time"); // NOI18N
- static final ParameterValue PV_FIELD_KEYWORDS = new ParameterValue("keywords", "keywords"); // NOI18N
- static final ParameterValue PV_FIELD_ESTIMATED_TIME = new ParameterValue("estimated_time", "estimated_time"); // NOI18N
- static final ParameterValue PV_FIELD_OP_SYS = new ParameterValue("op_sys", "op_sys"); // NOI18N
- static final ParameterValue PV_FIELD_PRIORITY = new ParameterValue("priority", "priority"); // NOI18N
- static final ParameterValue PV_FIELD_PRODUCT = new ParameterValue("product", "product"); // NOI18N
- static final ParameterValue PV_FIELD_QA_CONTACT = new ParameterValue("qa_contact", "qa_contact"); // NOI18N
- static final ParameterValue PV_FIELD_REPORTER_ACCESSIBLE = new ParameterValue("reporter_accessible", "reporter_accessible"); // NOI18N
- static final ParameterValue PV_FIELD_RESOLUTION = new ParameterValue("resolution", "resolution"); // NOI18N
- static final ParameterValue PV_FIELD_BUG_SEVERITY = new ParameterValue("bug_severity", "bug_severity"); // NOI18N
- static final ParameterValue PV_FIELD_BUG_STATUS = new ParameterValue("bug_status", "bug_status"); // NOI18N
- static final ParameterValue PV_FIELD_SHORT_DESC = new ParameterValue("short_desc", "short_desc"); // NOI18N
- static final ParameterValue PV_FIELD_TARGET_MILESTONE = new ParameterValue("target_milestone", "target_milestone"); // NOI18N
- static final ParameterValue PV_FIELD_BUG_FILE_LOC = new ParameterValue("bug_file_loc", "bug_file_loc"); // NOI18N
- static final ParameterValue PV_FIELD_VERSION = new ParameterValue("version", "version"); // NOI18N
- static final ParameterValue PV_FIELD_VOTES = new ParameterValue("votes", "votes"); // NOI18N
- static final ParameterValue PV_FIELD_STATUS_WHITEBOARD = new ParameterValue("status_whiteboard", "status_whiteboard"); // NOI18N
-
- static final ParameterValue[] PV_TEXT_SEARCH_VALUES = new ParameterValue[] {
- PV_CONTAINS_ALL_STRINGS,
- PV_CONTAINS_ANY_STRINGS,
- PV_CONTAINS_THE_STRING,
- PV_CONTAINS_THE_STRING_CASE,
- PV_CONTAINS_ALL_WORDS,
- PV_CONTAINS_ANY_WORDS,
- PV_MATCHES_REGEX,
- PV_DOESNT_MATCH_REGEX
- };
- static final ParameterValue[] PV_KEYWORDS_VALUES = new ParameterValue[] {
- PV_CONTAINS_ALL_KEYWORDS,
- PV_CONTAINS_ANY_KEYWORDS,
- PV_CONTAINS_NONE_KEYWORDS
- };
- static final ParameterValue[] PV_PEOPLE_VALUES = new ParameterValue[] {
- PV_CONTAINS,
- PV_IS,
- PV_MATCHES_REGEX,
- PV_DOESNT_MATCH_REGEX
- };
- static final ParameterValue[] PV_LAST_CHANGE = new ParameterValue[] {
- PV_FIELD_BUG_CREATION,
- PV_FIELD_ALIAS,
- PV_FIELD_ASSIGNED_TO,
- PV_FIELD_LIST_ACCESSIBLE,
- PV_FIELD_COMPONENT,
- PV_FIELD_DEADLINE,
- PV_FIELD_EVER_CONFIRMED,
- PV_FIELD_REP_PLARFORM,
- PV_FIELD_REMAINING_TIME,
- PV_FIELD_WORK_TIME,
- PV_FIELD_KEYWORDS,
- PV_FIELD_ESTIMATED_TIME,
- PV_FIELD_OP_SYS,
- PV_FIELD_PRIORITY,
- PV_FIELD_PRODUCT,
- PV_FIELD_QA_CONTACT,
- PV_FIELD_REPORTER_ACCESSIBLE,
- PV_FIELD_RESOLUTION,
- PV_FIELD_BUG_SEVERITY,
- PV_FIELD_BUG_STATUS,
- PV_FIELD_SHORT_DESC,
- PV_FIELD_TARGET_MILESTONE,
- PV_FIELD_BUG_FILE_LOC,
- PV_FIELD_VERSION,
- PV_FIELD_VOTES,
- PV_FIELD_STATUS_WHITEBOARD
- };
-
- private final ChangeSupport support = new ChangeSupport(this);
- private final String parameter;
- private final String encoding;
- protected boolean alwaysDisabled = false;
- public QueryParameter(String parameter, String encoding) {
- this.parameter = parameter;
- this.encoding = encoding;
- }
- public String getParameter() {
- return parameter;
- }
-
- void addChangeListener(ChangeListener l) {
- support.addChangeListener(l);
- }
-
- void removeChangeListener(ChangeListener l) {
- support.removeChangeListener(l);
- }
-
- protected void fireStateChanged() {
- support.fireChange();
- }
-
- abstract boolean isChanged();
-
- abstract void reset();
-
- abstract ParameterValue[] getValues();
- abstract void setValues(ParameterValue[] pvs);
- void setAlwaysDisabled(boolean bl) {
- this.alwaysDisabled = bl;
- setEnabled(false); // true or false, who cares. this is only to trigger the state change
- }
- abstract void setEnabled(boolean b);
-
- public StringBuffer get(boolean encode) {
- StringBuffer sb = new StringBuffer();
- ParameterValue[] values = getValues();
- for (ParameterValue pv : values) {
- sb.append("&"); // NOI18N
- sb.append(getParameter());
- sb.append("="); // NOI18N
- if(encode) {
- try {
- String value = pv.getValue();
- if(value.equals("[Bug+creation]")) { // NOI18N
- // workaround: while encoding '+' in a products name works fine,
- // encoding it in in [Bug+creation] causes an error
- sb.append(URLEncoder.encode("[", encoding)); // NOI18N
- sb.append("Bug+creation"); // NOI18N
- sb.append(URLEncoder.encode("]", encoding)); // NOI18N
- } else {
- // use URLEncoder as it is used also by other clients of the bugzilla connector
- sb.append(URLEncoder.encode(value, encoding));
- }
- } catch (UnsupportedEncodingException ex) {
- sb.append(URLEncoder.encode(pv.getValue()));
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- }
- } else {
- sb.append(pv.getValue());
- }
- }
- return sb;
- }
-
- @Override
- public String toString() {
- StringBuffer sb = new StringBuffer();
- sb.append("["); // NOI18N
- sb.append(get(true));
- sb.append("]"); // NOI18N
- return sb.toString();
- }
-
- static class ComboParameter extends QueryParameter {
- private final JComboBox combo;
- ParameterValue original = null;
- public ComboParameter(JComboBox combo, String parameter, String encoding) {
- super(parameter, encoding);
- this.combo = combo;
- combo.setModel(new DefaultComboBoxModel());
- combo.addItemListener(new ItemListener() {
- @Override
- public void itemStateChanged(ItemEvent e) {
- fireStateChanged();
- }
- });
- original = (ParameterValue) combo.getSelectedItem();
- }
-
- @Override
- public boolean isChanged() {
- Object item = ComboParameter.this.combo.getSelectedItem();
- if(item instanceof ParameterValue) {
- ParameterValue pv = (ParameterValue) item;
- if(original == null && pv == null) {
- return false;
- }
- if((original != null && pv == null) ||
- (original == null && pv != null))
- {
- return true;
- }
- return !pv.equals(original);
- }
- return false;
- }
-
- @Override
- void reset() {
- original = (ParameterValue) combo.getSelectedItem();
- fireStateChanged();
- }
-
- @Override
- public ParameterValue[] getValues() {
- ParameterValue value = (ParameterValue) combo.getSelectedItem();
- return value != null ? new ParameterValue[] { value } : EMPTY_PARAMETER_VALUE;
- }
- public void setParameterValues(ParameterValue[] values) {
- combo.setModel(new DefaultComboBoxModel(values));
- }
- @Override
- public void setValues(ParameterValue[] values) {
- assert values.length < 2;
- if(values.length == 0) return;
- ParameterValue pv = values[0];
-
- // need the index as the given ParameterValue might have a different displayName
- int idx = ((DefaultComboBoxModel)combo.getModel()).getIndexOf(pv);
- if(idx != -1) {
- combo.setSelectedIndex(idx);
- }
- reset();
- }
- @Override
- void setEnabled(boolean b) {
- combo.setEnabled(alwaysDisabled ? false : b);
- }
- }
-
- static class ListParameter extends QueryParameter {
- private final JList list;
- private int[] original;
- public ListParameter(JList list, String parameter, String encoding) {
- super(parameter, encoding);
- this.list = list;
- list.setModel(new DefaultListModel());
- list.addListSelectionListener(new ListSelectionListener(){
- @Override
- public void valueChanged(ListSelectionEvent e) {
- int[] s = ListParameter.this.list.getSelectedIndices();
- if(e.getValueIsAdjusting()) {
- return;
- }
- fireStateChanged();
- };
- });
- original = list.getSelectedIndices();
- fireStateChanged();
- }
- @Override
- public ParameterValue[] getValues() {
- Object[] values = list.getSelectedValues();
- if(values == null || values.length == 0) {
- return EMPTY_PARAMETER_VALUE;
- }
- ParameterValue[] ret = new ParameterValue[values.length];
- for (int i = 0; i < values.length; i++) {
- ret[i] = (ParameterValue) values[i];
- }
- return ret;
- }
- public void setParameterValues(List values) {
- setParameterValues(values.toArray(new ParameterValue[0]));
- }
- public void setParameterValues(ParameterValue[] values) {
- DefaultListModel m = new DefaultListModel<>();
- for (ParameterValue pv : values) {
- m.addElement(pv);
- }
- list.setModel(m);
- }
-
- @Override
- public void setValues(ParameterValue[] values) {
- if(values.length == 0) return; // should not happen XXX do we need this?
- list.clearSelection();
- if(values.length == 1 && "".equals(values[0].getValue().trim())) return; // 1 empty ParameterValue stands for no selection XXX rewrite this
- List selectionList = new LinkedList();
- for (int i = 0; i < values.length; i++) {
- ListModel model = list.getModel();
- // need case sensitive compare
- for(int j = 0; j < model.getSize(); j++) {
- ParameterValue pv = (ParameterValue) model.getElementAt(j);
- if(pv.getValue().equalsIgnoreCase(values[i].getValue())) {
- selectionList.add(j);
- break;
- }
- }
- }
- int[] selection = new int[selectionList.size()];
- int i = 0;
- for (int s : selectionList) {
- selection[i++] = s;
- }
- list.setSelectedIndices(selection);
- reset();
- int idx = selection.length > 0 ? selection[0] : -1;
- if(idx > -1) list.scrollRectToVisible(list.getCellBounds(idx, idx));
- }
-
- @Override
- void setEnabled(boolean b) {
- list.setEnabled(alwaysDisabled ? false : b);
- }
-
- @Override
- boolean isChanged() {
- int[] s = ListParameter.this.list.getSelectedIndices();
- int[] selection = list.getSelectedIndices();
- if(original == null && selection == null) {
- return true;
- }
- if( (original == null && selection != null) ||
- (original != null && selection == null) )
- {
- return true;
- }
- if(original.length == selection.length) {
- Arrays.sort(original);
- Arrays.sort(selection);
- return !Arrays.equals(original, selection);
- } else {
- return true;
- }
- }
-
- @Override
- void reset() {
- original = list.getSelectedIndices();
- fireStateChanged();
- }
- }
-
- /**
- * Some parameters should not be present in a query URL when they're empty.
- * For example &chfield= does not seem to be valid.
- *
- * This parameter type works the same way as ListParameter except getValues()
- * returns an empty array instead of an array of a single empty value when
- * the selection is empty.
- */
- static class EmptyValuesListParameter extends ListParameter {
-
- private final JList list;
-
- public EmptyValuesListParameter (JList list, String parameter, String encoding) {
- super(list, parameter, encoding);
- this.list = list;
- }
-
- @Override
- public ParameterValue[] getValues() {
- if (list.getSelectedValuesList().isEmpty()) {
- return new ParameterValue[0];
- } else {
- return super.getValues();
- }
- }
-
- @Override
- public String toString() {
- if (list.getSelectedValuesList().isEmpty()) {
- return new StringBuilder("[&").append(getParameter()).append("=]").toString(); //NOI18N
- } else {
- return super.toString();
- }
- }
- }
-
- static class TextFieldParameter extends QueryParameter {
- private final JTextField txt;
- private final boolean allWords;
- private String original;
- public TextFieldParameter(JTextField txt, String parameter, String encoding) {
- this(txt, parameter, encoding, false);
- }
- public TextFieldParameter(JTextField txt, String parameter, String encoding, boolean allWords) {
- super(parameter, encoding);
- this.txt = txt;
- this.allWords = allWords;
- txt.getDocument().addDocumentListener(new DocumentListener(){
- @Override
- public void insertUpdate(DocumentEvent e) {
- update();
- }
- @Override
- public void removeUpdate(DocumentEvent e) {
- update();
- }
- @Override
- public void changedUpdate(DocumentEvent e) {
- update();
- }
- private void update() {
- fireStateChanged();
- }
- });
- original = txt.getText();
- }
-
- @Override
- public ParameterValue[] getValues() {
- String value = txt.getText();
- if(value == null || value.equals("")) { // NOI18N
- return EMPTY_PARAMETER_VALUE;
- }
- String[] split = value.split(" "); // NOI18N
- StringBuffer sb = new StringBuffer();
- for (int i = 0; i < split.length; i++) {
- String s = split[i];
- sb.append(s);
- if(i < split.length - 1) {
- sb.append(allWords ? " " : "+"); // NOI18N
- }
- }
- String v = sb.toString();
- return new ParameterValue[] { new ParameterValue(v, v) };
- }
- @Override
- public void setValues(ParameterValue[] pvs) {
- assert pvs.length < 2;
- if(pvs.length == 0 || pvs[0] == null) {
- return;
- }
- String value = pvs[0].getValue();
- if(!allWords) {
- value = value.replace("+", " "); // NOI18N
- }
- txt.setText(value);
- reset();
- }
- @Override
- void setEnabled(boolean b) {
- txt.setEnabled(alwaysDisabled ? false : b);
- }
-
- @Override
- boolean isChanged() {
- String t = txt.getText() + "";
- return !t.equals(original);
- }
-
- @Override
- void reset() {
- original = txt.getText();
- fireStateChanged();
- }
- }
-
- static class AllWordsTextFieldParameter extends TextFieldParameter {
- public AllWordsTextFieldParameter(JTextField txt, String parameter, String encoding) {
- super(txt, parameter, encoding, true);
- }
- }
-
- static class CheckBoxParameter extends QueryParameter {
- private ParameterValue[] selected = new ParameterValue[] {new ParameterValue("1")}; // NOI18N
- private final JCheckBox chk;
- private boolean original;
- public CheckBoxParameter(JCheckBox chk, String parameter, String encoding) {
- super(parameter, encoding);
- this.chk = chk;
- chk.addActionListener(new ActionListener(){
- @Override
- public void actionPerformed(ActionEvent e) {
- fireStateChanged();
- }
- });
- original = chk.isSelected();
- }
- @Override
- public ParameterValue[] getValues() {
- return chk.isSelected() ? selected : EMPTY_PARAMETER_VALUE;
- }
- @Override
- public void setValues(ParameterValue[] pvs) {
- assert pvs.length < 2;
- if(pvs.length == 0 || pvs[0] == null) {
- return;
- }
- chk.setSelected(pvs[0].getValue().equals("1")); // NOI18N
- reset();
- }
- @Override
- void setEnabled(boolean b) {
- chk.setEnabled(alwaysDisabled ? false : b);
- }
-
- @Override
- boolean isChanged() {
- return chk.isSelected() != original;
- }
-
- @Override
- void reset() {
- original = chk.isSelected();
- fireStateChanged();
- }
- }
-
- static class ParameterValue {
- private final String displayName;
- private final String value;
- private String toString;
- public ParameterValue(String value) {
- this(value, value);
- }
- public ParameterValue(String displayName, String value) {
- assert displayName != null;
- assert value != null;
- this.displayName = displayName;
- this.value = value;
- }
- public String getDisplayName() {
- return displayName;
- }
- public String getValue() {
- return value;
- }
- @Override
- public String toString() {
- if(toString == null) {
- StringBuffer sb = new StringBuffer();
- sb.append(displayName);
- sb.append("["); // NOI18N
- sb.append(value);
- sb.append("]"); // NOI18N
- toString = sb.toString();
- }
- return toString;
- }
- @Override
- public boolean equals(Object obj) {
- if(obj instanceof ParameterValue) {
- ParameterValue pv = (ParameterValue) obj;
- return value.equals(pv.value);
- }
- return false;
- }
- @Override
- public int hashCode() {
- return value.hashCode();
- }
- }
-
- static class ParameterValueCellRenderer extends DefaultListCellRenderer {
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- if(value instanceof ParameterValue) value = ((ParameterValue)value).getDisplayName();
- return super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- }
- }
-
- static class PriorityRenderer extends ParameterValueCellRenderer {
- @Override
- public Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus) {
- JLabel renderer = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus);
- if(value instanceof ParameterValue) {
- String prio = ((ParameterValue)value).getValue();
- renderer.setIcon(BugzillaConfig.getInstance().getPriorityIcon(prio));
- } else {
- renderer.setIcon(null);
- }
- return renderer;
- }
- }
-
- public static class SimpleQueryParameter extends QueryParameter {
- private final String[] values;
-
- public SimpleQueryParameter(String parameter, String[] values, String encoding) {
- super(parameter, encoding);
- this.values = values;
- }
-
- @Override
- ParameterValue[] getValues() {
- if(values == null || values.length == 0) {
- return EMPTY_PARAMETER_VALUE;
- }
- ParameterValue[] ret = new ParameterValue[values.length];
- for (int i = 0; i < values.length; i++) {
- ret[i] = new ParameterValue(values[i]);
- }
- return ret;
- }
-
- @Override
- void setValues(ParameterValue[] values) {
- // not interested
- }
-
- @Override
- void setEnabled(boolean b) {
- // interested
- }
-
- @Override
- boolean isChanged() {
- // used only from simple search - not expected to be called
- assert false;
- return false;
- }
-
- @Override
- void reset() {
- // used only from simple search - not expected to be called
- assert false;
- }
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java
deleted file mode 100644
index 46ade3342ef7..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaConfiguration.java
+++ /dev/null
@@ -1,324 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.repository;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.LinkedList;
-import java.util.List;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaCustomField;
-import org.eclipse.mylyn.internal.bugzilla.core.BugzillaVersion;
-import org.eclipse.mylyn.internal.bugzilla.core.RepositoryConfiguration;
-import org.netbeans.modules.bugzilla.commands.GetConfigurationCommand;
-
-/**
- *
- * @author Tomas Stupka
- */
-public class BugzillaConfiguration {
-
- // XXX simplify this. no need to hold this.
- // its cached in bugzillacoreplugin - get it from there.
- private RepositoryConfiguration rc;
-
- public synchronized void initialize(BugzillaRepository repository, boolean forceRefresh) {
- this.rc = getRepositoryConfiguration(repository, forceRefresh);
- }
-
- protected RepositoryConfiguration getRepositoryConfiguration(final BugzillaRepository repository, final boolean forceRefresh) {
- GetConfigurationCommand cmd = new GetConfigurationCommand(forceRefresh, repository);
- repository.getExecutor().execute(cmd, true, false);
- return cmd.getConf();
- }
-
- public boolean isValid() {
- return rc != null;
- }
-
- /**
- * Returns all products defined in the given repository
- *
- * @param repository
- * @return
- */
- public List getProducts() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getProducts();
- }
-
- /**
- * Returns the componets for the given product or all known components if product is null
- *
- * @param repository
- * @param product
- * @return list of components
- */
- public List getComponents(String product) {
- if(rc == null) {
- return Collections.emptyList();
- }
- if(product == null) {
- return rc.getComponents();
- } else {
- return rc. getComponents(product);
- }
- }
-
- /**
- * Returns all resolutions defined in the given repository
- *
- * @param repository
- * @return
- */
- public List getResolutions() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getResolutions();
- }
-
- /**
- * Returns versiones defined for the given product or all available versions if product is null
- *
- * @param repository
- * @param product
- * @return
- */
- public List getVersions(String product) {
- if(rc == null) {
- return Collections.emptyList();
- }
- if(product == null) {
- return rc.getVersions();
- } else {
- return rc.getVersions(product);
- }
- }
-
- /**
- * Returns all status defined in the given repository
- * @param repository
- * @return
- */
- public List getStatusValues() {
- if(rc == null) {
- return Collections.emptyList();
- }
- List ret = new LinkedList(rc.getOpenStatusValues());
- ret.addAll(rc.getClosedStatusValues());
- return ret;
- }
-
- /**
- * Returns all open statuses defined in the given repository.
- * @param repository
- * @return all open statuses defined in the given repository.
- */
- public List getOpenStatusValues() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getOpenStatusValues();
- }
-
- /**
- * Returns all priorities defined in the given repository
- * @param repository
- * @return
- */
- public List getPriorities() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getPriorities();
- }
-
- /**
- * Returns all keywords defined in the given repository
- * @param repository
- * @return
- */
- public List getKeywords() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getKeywords();
- }
-
- /**
- * Returns all platforms defined in the given repository
- * @param repository
- * @return
- */
- public List getPlatforms() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getPlatforms();
- }
-
- /**
- * Returns all operating systems defined in the given repository
- * @param repository
- * @return
- */
- public List getOSs() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getOSs();
- }
-
- /**
- * Returns all severities defined in the given repository
- * @param repository
- * @return
- */
- public List getSeverities() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getSeverities();
- }
-
- /**
- * Returns all issue types defined in the given repository.
- * WARNING - works only for the bugzilla hosting netbeans
- *
- * @param repository
- * @return
- */
- public List getIssueTypes() {
- if(rc == null) {
- return Collections.emptyList();
- }
- List fields = rc.getCustomFields();
- for (BugzillaCustomField field : fields) {
- if(field.getName().equals("cf_bug_type")) { // NOI18N
- return field.getOptions();
- }
- }
- return Collections.emptyList();
- }
-
- /**
- * Returns all custom fields defined in the given repository
- * @param repository
- * @return
- */
- public List getCustomFields() {
- if(rc == null) {
- return Collections.emptyList();
- }
- return rc.getCustomFields();
- }
-
- /**
- * Returns target milestones defined for the given product or all available
- * milestones if product is null
- *
- * @param repository
- * @param product
- * @return
- */
- public List getTargetMilestones(String product) {
- if(rc == null) {
- return Collections.emptyList();
- }
- if(product == null) {
- return rc.getTargetMilestones();
- } else {
- return rc.getTargetMilestones(product);
- }
- }
-
- /**
- * Returns the bugzilla repositories version
- * @return
- */
- public BugzillaVersion getInstalledVersion() {
- if(rc == null) {
- return null;
- }
- return rc.getInstallVersion();
- }
-
- private List issueFields;
- public List getFields() {
- if (issueFields == null) {
- List fields = new ArrayList(40);
- fields.add(IssueField.SUMMARY);
- fields.add(IssueField.WHITEBOARD);
- fields.add(IssueField.STATUS);
- fields.add(IssueField.PRIORITY);
- fields.add(IssueField.RESOLUTION);
- fields.add(IssueField.PRODUCT);
- fields.add(IssueField.COMPONENT);
- fields.add(IssueField.VERSION);
- fields.add(IssueField.PLATFORM);
- fields.add(IssueField.OS);
- fields.add(IssueField.MILESTONE);
- fields.add(IssueField.REPORTER);
- fields.add(IssueField.REPORTER_NAME);
- fields.add(IssueField.ASSIGNED_TO);
- fields.add(IssueField.ASSIGNED_TO_NAME);
- fields.add(IssueField.QA_CONTACT);
- fields.add(IssueField.QA_CONTACT_NAME);
- fields.add(IssueField.DEPENDS_ON);
- fields.add(IssueField.BLOCKS);
- fields.add(IssueField.URL);
- fields.add(IssueField.KEYWORDS);
- fields.add(IssueField.SEVERITY);
- fields.add(IssueField.ISSUE_TYPE);
- fields.add(IssueField.DESCRIPTION);
- fields.add(IssueField.CREATION);
- fields.add(IssueField.CC);
- fields.add(IssueField.MODIFICATION);
- fields.add(IssueField.NEWCC);
- fields.add(IssueField.REMOVECC);
- fields.add(IssueField.COMMENT_COUNT);
- fields.add(IssueField.ATTACHEMENT_COUNT);
- fields.add(IssueField.ESTIMATED_TIME);
- fields.add(IssueField.WORK_TIME);
- fields.add(IssueField.REMAINING_TIME);
- fields.add(IssueField.DEADLINE);
-
- if(rc != null) {
- // Custom fields
- for (BugzillaCustomField field : rc.getCustomFields()) {
- fields.add(new CustomIssueField(field));
- }
- }
- issueFields = fields;
- }
- return issueFields;
- }
-
- public IssueField getField(String key) {
- for (IssueField issueField : getFields()) {
- if(issueField.getKey().equals(key)) {
- return issueField;
- }
- }
- return null;
- }
-}
diff --git a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java b/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java
deleted file mode 100644
index b4f1c2c7e107..000000000000
--- a/ide/bugzilla/src/org/netbeans/modules/bugzilla/repository/BugzillaRepository.java
+++ /dev/null
@@ -1,757 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.netbeans.modules.bugzilla.repository;
-
-import java.awt.EventQueue;
-import org.netbeans.modules.bugzilla.*;
-import java.awt.Image;
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.beans.PropertyChangeSupport;
-import java.io.UnsupportedEncodingException;
-import java.lang.ref.Reference;
-import java.lang.ref.SoftReference;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.LinkedList;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-import java.util.logging.Level;
-import javax.swing.SwingUtilities;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.OperationCanceledException;
-import org.eclipse.mylyn.commons.net.AuthenticationCredentials;
-import org.eclipse.mylyn.commons.net.AuthenticationType;
-import org.eclipse.mylyn.internal.bugzilla.core.IBugzillaConstants;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-import org.eclipse.mylyn.tasks.core.TaskRepository;
-import org.netbeans.modules.bugzilla.issue.BugzillaIssue;
-import org.netbeans.modules.bugzilla.query.BugzillaQuery;
-import org.netbeans.modules.team.spi.RepositoryUser;
-import org.netbeans.modules.bugtracking.spi.*;
-import org.netbeans.modules.team.spi.OwnerInfo;
-import org.netbeans.modules.bugzilla.commands.BugzillaExecutor;
-import org.netbeans.modules.bugzilla.query.QueryController;
-import org.netbeans.modules.bugzilla.query.QueryParameter;
-import org.netbeans.modules.bugzilla.util.BugzillaConstants;
-import org.netbeans.modules.bugzilla.util.BugzillaUtil;
-import org.netbeans.modules.mylyn.util.commands.GetRepositoryTasksCommand;
-import org.netbeans.modules.mylyn.util.MylynSupport;
-import org.netbeans.modules.mylyn.util.MylynUtils;
-import org.netbeans.modules.mylyn.util.NbTask;
-import org.netbeans.modules.mylyn.util.commands.SimpleQueryCommand;
-import org.netbeans.modules.mylyn.util.commands.SynchronizeTasksCommand;
-import org.netbeans.modules.mylyn.util.UnsubmittedTasksContainer;
-import org.netbeans.modules.team.spi.TeamAccessorUtils;
-import org.openide.nodes.Node;
-import org.openide.util.ImageUtilities;
-import org.openide.util.NbBundle;
-import org.openide.util.RequestProcessor;
-import org.openide.util.RequestProcessor.Task;
-import org.openide.util.WeakListeners;
-import org.eclipse.mylyn.tasks.core.IRepositoryQuery;
-
-/**
- *
- * @author Tomas Stupka, Jan Stola
- */
-public class BugzillaRepository {
-
- private static final String ICON_PATH = "org/netbeans/modules/bugtracking/ui/resources/repository.png"; // NOI18N
-
- private RepositoryInfo info;
- private TaskRepository taskRepository;
- private BugzillaRepositoryController controller;
- private Set queries = null;
- private Cache cache;
- private BugzillaExecutor executor;
- private Image icon;
- private BugzillaConfiguration bc;
-
- private PropertyChangeSupport support;
-
- private final Object RC_LOCK = new Object();
- private final Object CACHE_LOCK = new Object();
- private UnsubmittedTasksContainer unsubmittedTasksContainer;
- private PropertyChangeListener unsubmittedTasksListener;
- private boolean queryCleanedup = false;
-
- public BugzillaRepository() {
- icon = ImageUtilities.loadImage(ICON_PATH, true);
- support = new PropertyChangeSupport(this);
- }
-
- public BugzillaRepository(RepositoryInfo info) {
- this();
- this.info = checkAndPatchNetbeansUrl(info);
- String name = this.info.getDisplayName();
- String url = this.info.getUrl();
- boolean shortLoginEnabled = Boolean.parseBoolean(this.info.getValue(IBugzillaConstants.REPOSITORY_SETTING_SHORT_LOGIN));
- taskRepository = setupTaskRepository(name, null, url, "", new char[0], "", new char[0], shortLoginEnabled);
- }
-
- public RepositoryInfo getInfo() {
- return info;
- }
-
- public String getID() {
- return info.getID();
- }
-
- public TaskRepository getTaskRepository() {
- return taskRepository;
- }
-
- public BugzillaQuery createQuery() {
- BugzillaConfiguration conf = getConfiguration();
- if(conf == null || !conf.isValid()) {
- // invalid connection data?
- return null;
- }
- BugzillaQuery q = new BugzillaQuery(this);
- return q;
- }
-
- public BugzillaIssue createIssue() {
- BugzillaConfiguration conf = getConfiguration();
- if(conf == null || !conf.isValid()) {
- // invalid connection data?
- return null;
- }
-
- String product = null;
- String component = null;
- for (String productCandidate : conf.getProducts()) {
- // iterates because a product without a component throws NPE inside mylyn
- List components = conf.getComponents(productCandidate);
- if (!components.isEmpty()) {
- product = productCandidate;
- component = components.get(0);
- break;
- }
- }
-
- NbTask task;
- try {
- task = MylynSupport.getInstance().createTask(taskRepository, new TaskMapping(product, component));
- return getIssueForTask(task);
- } catch (OperationCanceledException ex) {
- // creation of new task may be immediately canceled
- // happens when more repositories are available and
- // the RepoComboSupport immediately switches to another repo
- Bugzilla.LOG.log(Level.FINE, null, ex);
- return null;
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- return null;
- }
- }
-
- public void remove() {
- Collection qs = getQueries();
- BugzillaQuery[] toRemove = qs.toArray(new BugzillaQuery[0]);
- for (BugzillaQuery q : toRemove) {
- removeQuery(q);
- }
- resetRepository(true);
- if (getTaskRepository() != null) {
- // Maybe it's not needed to remove in mylyn?
- }
- }
-
- public BugzillaIssue getIssueForTask (NbTask task) {
- BugzillaIssue issue = null;
- if (task != null) {
- synchronized (CACHE_LOCK) {
- String taskId = BugzillaIssue.getID(task);
- Cache issueCache = getIssueCache();
- issue = issueCache.getIssue(taskId);
- if (issue == null) {
- issue = issueCache.setIssue(taskId, new BugzillaIssue(task, this));
- }
- }
- }
- return issue;
- }
-
- public void taskDeleted (String taskId) {
- getIssueCache().removeIssue(taskId);
- }
-
- public Collection getUnsubmittedIssues () {
- try {
- UnsubmittedTasksContainer cont = getUnsubmittedTasksContainer();
- List unsubmittedTasks = cont.getTasks();
- List unsubmittedIssues = new ArrayList(unsubmittedTasks.size());
- for (NbTask task : unsubmittedTasks) {
- BugzillaIssue issue = getIssueForTask(task);
- if (issue != null) {
- unsubmittedIssues.add(issue);
- }
- }
- return unsubmittedIssues;
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.INFO, null, ex);
- return Collections.emptyList();
- }
- }
-
- /**
- * Do not call this method other than from BugzillaConfig.
- * To be overridden by KenaiRepository
- */
- public BugzillaQuery createPersistentQuery (String queryName, String urlParams, boolean urlDef) {
- IRepositoryQuery query = null;
- try {
- query = MylynSupport.getInstance().getRepositoryQuery(getTaskRepository(), queryName);
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.WARNING, null, ex);
- }
- return new BugzillaQuery(queryName, query, this, urlParams, true, urlDef, true);
- }
-
- synchronized void resetRepository(boolean keepConfiguration) {
- if(!keepConfiguration) {
- bc = null;
- }
- }
-
- public String getDisplayName() {
- return info.getDisplayName();
- }
-
- private String getTooltip(String repoName, String user, String url) {
- return NbBundle.getMessage(BugzillaRepository.class, "LBL_RepositoryTooltip", new Object[] {repoName, user, url}); // NOI18N
- }
-
- public Image getIcon() {
- return icon;
- }
-
- public String getUsername() {
- AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.REPOSITORY);
- return c != null ? c.getUserName() : ""; // NOI18N
- }
-
- public char[] getPassword() {
- AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.REPOSITORY);
- return c != null ? c.getPassword().toCharArray() : new char[0];
- }
-
- public String getHttpUsername() {
- AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.HTTP);
- return c != null ? c.getUserName() : ""; // NOI18N
- }
-
- public char[] getHttpPassword() {
- AuthenticationCredentials c = getTaskRepository().getCredentials(AuthenticationType.HTTP);
- return c != null ? c.getPassword().toCharArray() : new char[0];
- }
-
- public List getIssues(final String... ids) {
- final List ret = new LinkedList();
- try {
- MylynSupport supp = MylynSupport.getInstance();
- Set unknownTasks = new HashSet(ids.length);
- for (String id : ids) {
- BugzillaIssue issue = findUnsubmitted(id);
- if (issue == null) {
- issue = getIssueForTask(supp.getTask(getTaskRepository().getUrl(), id));
- }
- if (issue == null) {
- // must go online
- unknownTasks.add(id);
- } else {
- ret.add(issue);
- }
- }
- if (!unknownTasks.isEmpty()) {
- GetRepositoryTasksCommand cmd = supp.getCommandFactory()
- .createGetRepositoryTasksCommand(taskRepository, unknownTasks);
- getExecutor().execute(cmd, true);
- for (NbTask task : cmd.getTasks()) {
- BugzillaIssue issue = getIssueForTask(task);
- if (issue != null) {
- ret.add(issue);
- }
- }
- }
- } catch (CoreException ex) {
- Bugzilla.LOG.log(Level.INFO, null, ex);
- }
- return ret;
- }
-
- public BugzillaIssue getIssue(final String id) {
- assert !SwingUtilities.isEventDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
- BugzillaIssue issue = findUnsubmitted(id);
- if (issue == null) {
- issue = getIssueForTask(BugzillaUtil.getTask(this, id, true));
- }
- return issue;
- }
-
- // XXX create repo wih product if kenai project and use in queries
- public Collection simpleSearch(final String criteria) {
- assert taskRepository != null;
- assert !SwingUtilities.isEventDispatchThread() : "Accessing remote host. Do not call in awt"; // NOI18N
-
- String[] keywords = criteria.split(" "); // NOI18N
-
- final List issues = new ArrayList