Skip to content

Commit 588bd6f

Browse files
jisedlacthurka
authored andcommitted
Options category for filters and coloring
1 parent 7040bc8 commit 588bd6f

File tree

4 files changed

+675
-0
lines changed

4 files changed

+675
-0
lines changed

visualvm/appui/nbproject/project.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,24 @@
8787
<specification-version>2.8.1.1</specification-version>
8888
</run-dependency>
8989
</dependency>
90+
<dependency>
91+
<code-name-base>org.netbeans.lib.profiler</code-name-base>
92+
<build-prerequisite/>
93+
<compile-dependency/>
94+
<run-dependency>
95+
<release-version>1</release-version>
96+
<specification-version>1.108</specification-version>
97+
</run-dependency>
98+
</dependency>
99+
<dependency>
100+
<code-name-base>org.netbeans.lib.profiler.common</code-name-base>
101+
<build-prerequisite/>
102+
<compile-dependency/>
103+
<run-dependency>
104+
<release-version>1</release-version>
105+
<specification-version>1.48</specification-version>
106+
</run-dependency>
107+
</dependency>
90108
<dependency>
91109
<code-name-base>org.netbeans.lib.profiler.ui</code-name-base>
92110
<build-prerequisite/>
@@ -138,6 +156,14 @@
138156
<specification-version>6.11.1.1</specification-version>
139157
</run-dependency>
140158
</dependency>
159+
<dependency>
160+
<code-name-base>org.openide.dialogs</code-name-base>
161+
<build-prerequisite/>
162+
<compile-dependency/>
163+
<run-dependency>
164+
<specification-version>7.43</specification-version>
165+
</run-dependency>
166+
</dependency>
141167
<dependency>
142168
<code-name-base>org.openide.modules</code-name-base>
143169
<build-prerequisite/>
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
/*
2+
* Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
3+
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4+
*
5+
* This code is free software; you can redistribute it and/or modify it
6+
* under the terms of the GNU General Public License version 2 only, as
7+
* published by the Free Software Foundation. Oracle designates this
8+
* particular file as subject to the "Classpath" exception as provided
9+
* by Oracle in the LICENSE file that accompanied this code.
10+
*
11+
* This code is distributed in the hope that it will be useful, but WITHOUT
12+
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13+
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14+
* version 2 for more details (a copy is included in the LICENSE file that
15+
* accompanied this code).
16+
*
17+
* You should have received a copy of the GNU General Public License version
18+
* 2 along with this work; if not, write to the Free Software Foundation,
19+
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20+
*
21+
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22+
* or visit www.oracle.com if you need additional information or have any
23+
* questions.
24+
*/
25+
26+
package com.sun.tools.visualvm.modules.appui.options;
27+
28+
import com.sun.tools.visualvm.core.options.UISupport;
29+
import java.beans.PropertyChangeListener;
30+
import javax.swing.JComponent;
31+
import org.netbeans.modules.profiler.api.ProfilerIDESettings;
32+
import org.netbeans.spi.options.OptionsPanelController;
33+
import org.openide.util.HelpCtx;
34+
import org.openide.util.Lookup;
35+
import org.openide.util.NbBundle;
36+
37+
/**
38+
*
39+
* @author Jiri Sedlacek
40+
*/
41+
@OptionsPanelController.TopLevelRegistration(
42+
id = "FiltersOptions",
43+
categoryName = "#FiltersOptionsCategory_Name",
44+
iconBase = "com/sun/tools/visualvm/modules/appui/options/filters.png",
45+
position = 1550)
46+
@NbBundle.Messages({
47+
"FiltersOptionsCategory_Name=Filters"
48+
})
49+
public final class FiltersOptionsCategory extends OptionsPanelController {
50+
51+
private static final HelpCtx HELP_CTX = null;
52+
// private static final HelpCtx HELP_CTX = new HelpCtx("HeapViewerOptions.Help"); // NOI18N
53+
54+
public static final String OPTIONS_HANDLE = "HeapViewerOptions"; // NOI18N
55+
56+
private FiltersOptionsPanel settingsPanel;
57+
private JComponent settingsComponent;
58+
59+
60+
private FiltersOptionsPanel getPanel() {
61+
if (settingsPanel == null) settingsPanel = new FiltersOptionsPanel();
62+
return settingsPanel;
63+
}
64+
65+
public JComponent getComponent(Lookup lookup) {
66+
if (settingsComponent == null) settingsComponent = UISupport.createScrollableContainer(getPanel());
67+
return settingsComponent;
68+
}
69+
70+
public HelpCtx getHelpCtx() {
71+
return HELP_CTX;
72+
}
73+
74+
public boolean isChanged() {
75+
if (settingsPanel == null) return false;
76+
return !settingsPanel.equalsTo(ProfilerIDESettings.getInstance());
77+
}
78+
79+
public boolean isValid() {
80+
return true;
81+
}
82+
83+
public void applyChanges() {
84+
if (settingsPanel == null) return;
85+
settingsPanel.storeTo(ProfilerIDESettings.getInstance());
86+
}
87+
88+
public void cancel() {
89+
}
90+
91+
public void update() {
92+
if (settingsPanel == null) return;
93+
settingsPanel.loadFrom(ProfilerIDESettings.getInstance());
94+
}
95+
96+
public void addPropertyChangeListener(PropertyChangeListener l) {
97+
}
98+
99+
public void removePropertyChangeListener(PropertyChangeListener l) {
100+
}
101+
102+
}

0 commit comments

Comments
 (0)