[hg] main-silver: Issue #238687 - IllegalStateException: Problem...

  • From: Jan Peska < >
  • To:
  • Subject: [hg] main-silver: Issue #238687 - IllegalStateException: Problem...
  • Date: Thu, 09 Jan 2014 19:24:00 +0000

changeset 8d3242880130 in main-silver ((none))
details: http://hg.netbeans.org/main-silver/rev/8d3242880130
description:
        Issue #238687 - IllegalStateException: Problem in some module which 
uses Window System: Window System API is required to be called from AWT 
thread only, see http://core.netbeans.org/proposals/threading/
        Rewrite FilterPanel as singleton to be accessible without finding the 
TC object

diffstat:

 
bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardTopComponent.java
 |   2 +-
 bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java   
     |   2 +-
 bugtracking/src/org/netbeans/modules/bugtracking/tasks/FilterPanel.java      
     |  10 +++++++++-
 3 files changed, 11 insertions(+), 3 deletions(-)

diffs (45 lines):

diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardTopComponent.java
 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardTopComponent.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardTopComponent.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardTopComponent.java
@@ -122,7 +122,7 @@
         filterTimer = new Timer(500, new FilterTimerListener());
         filterTimer.stop();
         refresher = DashboardRefresher.getInstance();
-        filterPanel = new FilterPanel();
+        filterPanel = FilterPanel.getInstance();
         if (filterListener == null) {
             filterListener = new FilterDocumentListener(filterTimer);
         }
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java
--- 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java
+++ 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/DashboardUtils.java
@@ -237,7 +237,7 @@
     }
 
     private static String getFilterBoldText(String fitText) {
-        String filterText = 
DashboardTopComponent.findInstance().getFilterText();
+        String filterText = FilterPanel.getInstance().getFilterText();
         if (!filterText.equals("")) { //NOI18N
             int searchIndex = 0;
             StringBuilder sb = new StringBuilder(fitText);
diff --git 
a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/FilterPanel.java 
b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/FilterPanel.java
--- a/bugtracking/src/org/netbeans/modules/bugtracking/tasks/FilterPanel.java
+++ b/bugtracking/src/org/netbeans/modules/bugtracking/tasks/FilterPanel.java
@@ -80,8 +80,16 @@
     private final String THIS_WEEK_SETTING_ID = "scheduleThisWeek";
     private final String ALL_SETTING_ID = "scheduleAll";
     private ShowScheduleAction showTodayAction;
+    private static FilterPanel INSTANCE = null;
 
-    public FilterPanel() {
+    public static FilterPanel getInstance() {
+        if (INSTANCE == null) {
+            INSTANCE = new FilterPanel();
+        }
+        return INSTANCE;
+    }
+
+    private FilterPanel() {
         REQUEST_PROCESSOR = 
DashboardViewer.getInstance().getRequestProcessor();
         BACKGROUND_COLOR = 
ColorManager.getDefault().getExpandableRootBackground();
         FOREGROUND_COLOR = 
ColorManager.getDefault().getExpandableRootForeground();

[hg] main-silver: Issue #238687 - IllegalStateException: Problem...

Jan Peska 01/09/2014

Project Features

About this Project

ConnectedDeveloper was started in November 2009, is owned by tpavek, and has 95 members.
By use of this website, you agree to the NetBeans Policies and Terms of Use (revision 20150626.29986a4). © 2014, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo
 
 
Close
loading
Please Confirm
Close