Refine search
SavedDirFileChooser(String dirKey, File failoverDir, boolean force, SelectionApprover approver) { this.dirKey = dirKey; this.approver = approver; if (force && failoverDir != null && failoverDir.exists() && failoverDir.isDirectory()) { setCurrentDirectory(failoverDir); } else { String path = DONT_STORE_DIRECTORIES ? null : NbPreferences.forModule(FileChooserBuilder.class).get(dirKey, null); if (path != null) { File f = new File(path); if (f.exists() && f.isDirectory()) { setCurrentDirectory(f); } else if (failoverDir != null) { setCurrentDirectory(failoverDir); } } else if (failoverDir != null) { setCurrentDirectory(failoverDir); } } }
String nodeName = (String) prefsNodeOrLookup; if (nodeName.startsWith("system:")) { preferencesNode = Preferences.systemRoot(); if (preferencesNode != null) { nodeName = nodeName.substring("system:".length()); try { preferencesNode = preferencesNode.nodeExists(nodeName) ? preferencesNode.node(nodeName) : null; } catch (BackingStoreException ex) { preferencesNode = null; preferencesNode = NbPreferences.root(); if (preferencesNode != null) { try {
/** * Returns the root preference node. * * @return the root preference node. */ public static Preferences root() { if (PREFS_IMPL == null) { PREFS_IMPL = getPreferencesProvider(); } return PREFS_IMPL.preferencesRoot(); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ public static void setAutoSelectionEnabled (final boolean autoSelection) { NbPreferences.forModule(ExplorerSelectionStrategy.class).putBoolean(AUTO_SELECTION, autoSelection); }
@Override public void validate() throws IllegalStateException { Preferences prefs = NbPreferences.root().node("laf"); if (!prefs.getBoolean("darcula.installed", false)) { prefs.put("laf", DarculaLaf.class.getName()); SWITCH_EDITOR_COLORS = true; } prefs.putBoolean("darcula.installed", true); // to make LAF available in Tools > Options > Appearance > Look and Feel UIManager.installLookAndFeel(new UIManager.LookAndFeelInfo(DarculaLaf.NAME, DarculaLaf.class.getName())); UIManager.put("Nb.DarculaLFCustoms", new DarculaLFCustoms()); }
/** * Creates new form DuplicateColumnUI */ public ConvertColumnToDynamicUI() { initComponents(); intervalStartText.setText(NbPreferences.forModule(ConvertColumnToDynamicUI.class).get(INTERVAL_START_PREFERENCE, DEFAULT_INTERVAL_START)); intervalEndText.setText(NbPreferences.forModule(ConvertColumnToDynamicUI.class).get(INTERVAL_END_PREFERENCE, DEFAULT_INTERVAL_END)); replaceColumnCheckbox.setSelected(NbPreferences.forModule(ConvertColumnToDynamicUI.class).getBoolean(REPLACE_COLUMN_PREFERENCE, false)); }
/******************************************************************************************************************* * * ******************************************************************************************************************/ public static boolean isAutoSelectionEnabled() { return NbPreferences.forModule(ExplorerSelectionStrategy.class).getBoolean(AUTO_SELECTION, true); }
void load() { Preferences prefs = NbPreferences.forModule(DarculaLAFPanel.class); cbFontSizeOverride.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.OVERRIDE_FONT_BOOLEAN, false)); lblFontName.setText(prefs.get(DarculaLAFOptionsPanelController.FONT_STRING, DarculaLFCustoms.DEFAULT_FONT)); cbTreeIndentOverride.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.OVERRIDE_TREE_INDENT_BOOLEAN, false)); spTreeIndent.setValue(prefs.getInt(DarculaLAFOptionsPanelController.TREE_INDENT_INT, UIManager.getInt("Tree.leftChildIndent"))); cbInvertIcons.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.INVERT_ICONS_BOOLEAN, false)); cbStretchedTabs.setSelected(prefs.getBoolean(DarculaLAFOptionsPanelController.STRETCHED_TABS_BOOLEAN, false)); reinitUI(); }
void store() { Preferences prefs = NbPreferences.forModule(DarculaLAFPanel.class); prefs.putBoolean(DarculaLAFOptionsPanelController.OVERRIDE_FONT_BOOLEAN, cbFontSizeOverride.isSelected()); prefs.put(DarculaLAFOptionsPanelController.FONT_STRING, lblFontName.getText()); prefs.putBoolean(DarculaLAFOptionsPanelController.OVERRIDE_TREE_INDENT_BOOLEAN, cbTreeIndentOverride.isSelected()); prefs.putInt(DarculaLAFOptionsPanelController.TREE_INDENT_INT, (Integer) spTreeIndent.getValue()); prefs.putBoolean(DarculaLAFOptionsPanelController.INVERT_ICONS_BOOLEAN, cbInvertIcons.isSelected()); prefs.putBoolean(DarculaLAFOptionsPanelController.STRETCHED_TABS_BOOLEAN, cbStretchedTabs.isSelected()); }
void store() { //Default design settings NbPreferences.forModule(VizConfig.class).putBoolean(VizConfig.HIGHLIGHT, highlightCheckbox.isSelected()); NbPreferences.forModule(VizConfig.class).putBoolean(VizConfig.NEIGHBOUR_SELECT, autoSelectNeighborCheckbox.isSelected()); NbPreferences.forModule(VizConfig.class).put(VizConfig.BACKGROUND_COLOR, ColorUtils.encode(backgroundColor.getColor())); //Label settings NbPreferences.forModule(VizConfig.class).put(VizConfig.NODE_LABEL_COLOR, ColorUtils.encode(nodeLabelColorButton.getColor())); NbPreferences.forModule(VizConfig.class).put(VizConfig.EDGE_LABEL_COLOR, ColorUtils.encode(edgeLabelColorButton.getColor())); NbPreferences.forModule(VizConfig.class).put(VizConfig.NODE_LABEL_FONT, FontUtils.encode(nodeFont)); NbPreferences.forModule(VizConfig.class).put(VizConfig.EDGE_LABEL_FONT, FontUtils.encode(edgeFont)); }
private static void setLocalRepoPreference(Configuration req) { Preferences prefs = NbPreferences.root().node("org/netbeans/modules/maven"); //NOI18N String localRepo = prefs.get("localRepository", null); //NOI18N if (localRepo != null) { File file = new File(localRepo); if (file.exists() && file.isDirectory()) { req.setLocalRepository(file); } else if (!file.exists()) { file.mkdirs(); req.setLocalRepository(file); } } }
/** * boolean value representing the state of library sharability of the last created project. * To be used by new project wizards. * @return true if last created project was created sharable, false if not. */ public static boolean isLastProjectSharable() { return NbPreferences.forModule(SharableLibrariesUtils.class).getBoolean(PROP_LAST_SHARABLE, // For compatibility with incorrect old location: NbPreferences.root().node("org.netbeans.modules.java.project.share").getBoolean(PROP_LAST_SHARABLE, false)); // NOI18N } /**
/** * Get the destination dir for copy action * @return Destination for shape-files or shapefile dir to copy to */ private File getDestination() { StringBuilder sb = new StringBuilder(NbPreferences.root().get("user.dir", System.getProperty("user.dir"))); sb.append("/"); sb.append(AreaFieldPreference.SHAPE_FILE_ARCHIVE_DIR.getValue()); String appDir = sb.toString(); return new File(appDir); } }
void load() { antiAliasing = NbPreferences.forModule(VizConfig.class).getInt(VizConfig.ANTIALIASING, VizConfig.DEFAULT_ANTIALIASING); antialisaingCombobox.setSelectedIndex(antiAliasing == 0 ? 0 : Math.round((float) (Math.log(antiAliasing) / Math.log(2)))); fpsCheckbox.setSelected(NbPreferences.forModule(VizConfig.class).getBoolean(VizConfig.SHOW_FPS, VizConfig.DEFAULT_SHOW_FPS)); //OpenGLInfo GraphicalConfiguration gc = VizController.getInstance().getDrawable().getGraphicalConfiguration(); if (gc != null) { openInfoText.setText(gc.getVendor() + "\n" + gc.getRenderer() + "\nOpenGL2 " + gc.getVersionStr()); } }
public static boolean isShowAutos() { if (NativeDebuggerManager.isStandalone()) { return false; // always false in tool } Preferences preferences = NbPreferences.forModule(VariablesViewButtons.class).node(PREFERENCES_NAME); return preferences.getBoolean(SHOW_AUTOS, false); //disabled by default }
void store() { NbPreferences.forModule(VizConfig.class).putInt(VizConfig.ANTIALIASING, antiAliasing); NbPreferences.forModule(VizConfig.class).putBoolean(VizConfig.SHOW_FPS, fpsCheckbox.isSelected()); VizController.getInstance().getEngine().reinit(); }
public EditorSynchronizationSupport(EditorSynchronizable synchronizable) { this.synchronizable = synchronizable; Preferences nbPrefs = NbPreferences.root().node("org/netbeans/modules/projectui"); synchronizeViews = nbPrefs.getBoolean("synchronizeEditorWithViews", false); nbPrefs.addPreferenceChangeListener(new EditorSynchronizationSupport.NbPrefsListener()); selectionTask = createSelectionTask(); }