Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -423,4 +423,11 @@ public Object[] createGuaranteedKeysAndValues () {
public static final String PROGRESS_CANCEL_BUTTON_ICON = "nb.progress.cancel.icon";
public static final String PROGRESS_CANCEL_BUTTON_ROLLOVER_ICON = "nb.progress.cancel.icon.mouseover";
public static final String PROGRESS_CANCEL_BUTTON_PRESSED_ICON = "nb.progress.cancel.icon.pressed";

/**
* Keys used by the options dialog module.
*/
public static final String OPTIONS_USE_UI_DEFAULT_COLORS = "nb.options.useUIDefaultsColors";
public static final String OPTIONS_CATEGORIES_SEPARATOR_COLOR = "nb.options.categories.separatorColor";
public static final String OPTIONS_CATEGORIES_BUTTON_USE_NIMBUS = "nb.options.categories.button.useNimbusCategoryButton";
}
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ SCROLLPANE_BORDER, new JScrollPane().getViewportBorder(),
"NbSlideBar.GroupSeparator.Gap.Before", 7,
"NbSlideBar.GroupSeparator.Gap.After", 2,
"NbSlideBar.RestoreButton.Gap", 5,

// Options Panel
OPTIONS_USE_UI_DEFAULT_COLORS, true,
OPTIONS_CATEGORIES_SEPARATOR_COLOR, UIManager.getColor("Separator.foreground"),
OPTIONS_CATEGORIES_BUTTON_USE_NIMBUS, true,
};

//#108517 - turn off ctrl+page_up and ctrl+page_down mapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,9 @@ PROGRESS_CANCEL_BUTTON_ICON, filterImage( UIUtils.loadImage("org/netbeans/swing/
//browser picker
"Nb.browser.picker.background.light", new Color(249,249,249),
"Nb.browser.picker.foreground.light", new Color(130,130,130),

// Options Panel
OPTIONS_USE_UI_DEFAULT_COLORS, true,
}; //NOI18N

//#108517 - turn off ctrl+page_up and ctrl+page_down mapping
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ public Object createValue(UIDefaults table) {
//browser picker
"Nb.browser.picker.background.light", new Color(249,249,249),
"Nb.browser.picker.foreground.light", new Color(130,130,130),

// Options Panel
OPTIONS_USE_UI_DEFAULT_COLORS, true,
OPTIONS_CATEGORIES_BUTTON_USE_NIMBUS, true,
};
/*Object[] result = {
DESKTOP_BORDER, new EmptyBorder(1, 1, 1, 1),
Expand Down
2 changes: 1 addition & 1 deletion platform/options.api/nbproject/project.properties
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
# under the License.

javac.compilerargs=-Xlint:unchecked
javac.source=1.6
javac.source=1.8
javadoc.arch=${basedir}/arch.xml
javadoc.apichanges=${basedir}/apichanges.xml

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@
import javax.swing.border.CompoundBorder;
import javax.swing.border.EmptyBorder;
import javax.swing.border.LineBorder;
import javax.swing.plaf.metal.MetalLookAndFeel;
import javax.swing.text.JTextComponent;
import org.netbeans.modules.options.CategoryModel.Category;
import org.netbeans.modules.options.advanced.AdvancedPanel;
Expand All @@ -98,6 +97,10 @@
import org.openide.windows.WindowManager;

public class OptionsPanel extends JPanel {
private static final String OPTIONS_USE_UI_DEFAULT_COLORS = "nb.options.useUIDefaultsColors"; //NOI18N
private static final String OPTIONS_CATEGORIES_SEPARATOR_COLOR = "nb.options.categories.separatorColor"; //NOI18N
private static final String OPTIONS_CATEGORIES_BUTTON_USE_NIMBUS = "nb.options.categories.button.useNimbusCategoryButton"; //NOI18N

private JPanel pCategories;
private JPanel pCategories2;
private JScrollPane categoriesScrollPane;
Expand All @@ -116,20 +119,12 @@ public class OptionsPanel extends JPanel {
private HashMap<String, HashMap<Integer, TabInfo>> categoryid2tabs = new HashMap<String, HashMap<Integer, TabInfo>>();
private final ArrayList<String> disabledCategories = new ArrayList<String>();

//private final ArrayList<FileObject> advancedFOs = new ArrayList<FileObject>();
//private final HashMap<String, Integer> dublicateKeywordsFOs = new HashMap<String, Integer>();
//private final HashMap<FileObject, Integer> fo2index = new HashMap<FileObject, Integer>();

private Map<String, CategoryButton> buttons = new LinkedHashMap<String, CategoryButton>();
private final boolean isMac = UIManager.getLookAndFeel ().getID ().equals ("Aqua");
private final boolean isNimbus = UIManager.getLookAndFeel ().getID ().equals ("Nimbus");
private final boolean isMetal = UIManager.getLookAndFeel() instanceof MetalLookAndFeel;
private final boolean isGTK = UIManager.getLookAndFeel ().getID ().equals ("GTK");
private final Color selected = isMac ? new Color(221, 221, 221) : getSelectionBackground();
private final Color selectedB = isMac ? new Color(183, 183, 183) : getUIColorOrDefault("nb.options.categories.selectionBorderColor", new Color (149, 106, 197));
private final Color highlighted = isMac ? new Color(221, 221, 221) : getHighlightBackground();
private final Color highlightedB = getUIColorOrDefault("nb.options.categories.highlightBorderColor", new Color (152, 180, 226));
//private final Color iconViewBorder = new Color (127, 157, 185);
private final ControllerListener controllerListener = new ControllerListener ();

private final Color borderMac = new Color(141, 141, 141);
Expand Down Expand Up @@ -393,8 +388,9 @@ public void focusLost(FocusEvent e) {
showHint(true);

pCategories = new JPanel (new BorderLayout ());
pCategories.setBorder (BorderFactory.createMatteBorder(0,0,1,0,getUIColorOrDefault("nb.options.categories.separatorColor", Color.lightGray))); //NOI18N
pCategories.setBorder (BorderFactory.createMatteBorder(0, 0, 1, 0, getUIColorOrDefault(OPTIONS_CATEGORIES_SEPARATOR_COLOR, Color.lightGray)));
pCategories.setBackground (getTabPanelBackground());

categoriesScrollPane = new JScrollPane(pCategories2, ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER, ScrollPaneConstants.HORIZONTAL_SCROLLBAR_AS_NEEDED);
categoriesScrollPane.setBorder(null);
categoriesScrollPane.getHorizontalScrollBar().setUnitIncrement(Utils.ScrollBarUnitIncrement);
Expand Down Expand Up @@ -877,7 +873,7 @@ private void addCategoryButtons () {

private CategoryButton addButton (CategoryModel.Category category) {
int index = buttons.size ();
CategoryButton button = isNimbus || isGTK
CategoryButton button = UIManager.getBoolean(OPTIONS_CATEGORIES_BUTTON_USE_NIMBUS)
? new NimbusCategoryButton(category)
: new CategoryButton(category);

Expand Down Expand Up @@ -1027,8 +1023,13 @@ private Color getHighlightBackground() {
return new Color (224, 232, 246);
}

/**
* Get if Options Panel uses UI default colors.
* Use property nb.options.useUIDefaultsColors to use modify it.
* @return boolean
*/
private boolean useUIDefaultsColors() {
return isMetal || isNimbus;
return UIManager.getBoolean(OPTIONS_USE_UI_DEFAULT_COLORS);
}

private Color getUIColorOrDefault(String uiKey, Color defaultColor) {
Expand Down