當前位置: 首頁>>代碼示例>>Java>>正文


Java NbPreferences.forModule方法代碼示例

本文整理匯總了Java中org.openide.util.NbPreferences.forModule方法的典型用法代碼示例。如果您正苦於以下問題:Java NbPreferences.forModule方法的具體用法?Java NbPreferences.forModule怎麽用?Java NbPreferences.forModule使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.openide.util.NbPreferences的用法示例。


在下文中一共展示了NbPreferences.forModule方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: save

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
public void save() throws IOException {
    try {
        Preferences prefs = NbPreferences.forModule(FilterRepository.class);
        prefs = prefs.node("Filters"); //NOI18N
        prefs.clear();
        prefs.putBoolean("firstTimeStart", false); //NOI18N
        prefs.putBoolean("firstTimeStartWithIssue", false); //NOI18N

        prefs.putInt("count", filters.size()); //NOI18N
        prefs.putInt("active", active); //NOI18N
        for (int i = 0; i < filters.size(); i++) {
            NotificationFilter filter = filters.get(i);
            filter.save(prefs, "Filter_" + i); //NOI18N
        }
    } catch (BackingStoreException bsE) {
        throw new IOException("Cannot save filter repository", bsE);
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:19,代碼來源:FilterRepository.java

示例2: getNode

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private static synchronized Preferences getNode() {
    if ( node == null ) {                
        Preferences p = NbPreferences.forModule(UiOptions.class);
        node = p.node(GO_TO_TYPE_DIALOG);
    }
    return node;
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:8,代碼來源:UiOptions.java

示例3: load

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
void load() {
    // Set flags of map

    Preferences pref = NbPreferences.forModule(TimelinePanel.class);
    
    walkFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.WALK));
    flyFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.FLY));

    swimFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.SWIM));
    jumpFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.JUMP));

    doorFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.DOOR));
    specialFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.SPECIAL));

    ladderFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.LADDER));
    proscribedFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.PROSCRIBED));
    
    forcedFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.FORCED));
    playerOnlyFlagCheckBox.setSelected(getPrefBoolean(pref, MapFlag.PLAYER_ONLY));

    // Colors
    lowColorArea.setBackground(getPrefColor(pref, MapColor.LOW_COLOR_KEY));
    highColorArea.setBackground(getPrefColor(pref, MapColor.HIGH_COLOR_KEY));
    waypointsColorArea.setBackground(getPrefColor(pref, MapColor.WAYPOINTS_COLOR_KEY));

    if (pref.getBoolean(INCLUDE_FLAG_KEY, true)) {
        includeFlagsRadioButton.setSelected(true);
    } else {
        excludeFlagsRadioButton.setSelected(true);
    }
}
 
開發者ID:kefik,項目名稱:Pogamut3,代碼行數:32,代碼來源:TimelinePanel.java

示例4: startArgs

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
/**
 * Check whether some non-standard arguments are needed to start JavaDB.
 *
 * @return String containing non-standard arguments, prefixed by a space
 * character (if not empty).
 */
private String startArgs() {

    Preferences prefs = NbPreferences.forModule(RegisterDerby.class);
    if (prefs.getBoolean(DISABLE_SECURITY_MANAGER, false)) {
        return " -noSecurityManager";                               //NOI18N
    } else {
        return "";                                                  //NOI18N
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:16,代碼來源:RegisterDerby.java

示例5: getJavaModulePreferenes

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private Preferences getJavaModulePreferenes() {
    try {
        ClassLoader cl = Lookup.getDefault().lookup(ClassLoader.class);
        Class accpClass = cl.loadClass("org.netbeans.modules.editor.java.AbstractCamelCasePosition"); // NOI18N
        if (accpClass == null) {
            return null;
        }
        return NbPreferences.forModule(accpClass);
    } catch (ClassNotFoundException ex) {
        return null;
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:13,代碼來源:Model.java

示例6: storeRecentConnectionsList

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
void storeRecentConnectionsList() {
    Preferences prefs = NbPreferences.forModule(ConnectionManager.class);
    synchronized (recentConnections) {
        for (int i = 0; i < recentConnections.size(); i++) {
            prefs.put(getConnectoinsHistoryKey(i), ExecutionEnvironmentFactory.toUniqueID(recentConnections.get(i)));
        }
    }
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:9,代碼來源:ConnectionManager.java

示例7: getPreferences

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private static Preferences getPreferences() {
    return NbPreferences.forModule(AntArtifactChooser.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:AntArtifactChooser.java

示例8: getPreferences

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private static Preferences getPreferences () {
    return NbPreferences.forModule (LocalDownloadSupport.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:LocalDownloadSupport.java

示例9: getPreferences

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private static Preferences getPreferences() {
    return NbPreferences.forModule(WizardSettings.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:WizardSettings.java

示例10: getEJDKHome

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
@CheckForNull
private static File getEJDKHome() {
    final Preferences prefs = NbPreferences.forModule(CreateJREPanel.class);
    final String path = prefs.get(KEY_EJDK, null);
    return path == null ? null : new File(path);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:7,代碼來源:CreateJREPanel.java

示例11: getPreferences

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
public static Preferences getPreferences() {
    return NbPreferences.forModule(Settings.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:Settings.java

示例12: prefs

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private static Preferences prefs() {
    return NbPreferences.forModule(JavaProjectSettings.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:JavaProjectSettings.java

示例13: getPreferences

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
public Preferences getPreferences() {
    // legacy - use some public bugtracking type, 
    // to acces the previously (before 8.0) used preferences location
    return NbPreferences.forModule(BugtrackingSupport.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:6,代碼來源:IssueTable.java

示例14: getPreferences

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
private static Preferences getPreferences() {
    return NbPreferences.forModule(EditMediator.class);
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:4,代碼來源:EditMediator.java

示例15: testAutoSubmitUILogs

import org.openide.util.NbPreferences; //導入方法依賴的package包/類
/**
 * Tests auto-submission of UI logs.
 * 
 * @throws Exception 
 */
@RandomlyFails
public void testAutoSubmitUILogs() throws Exception {
    // Needs to be call in the thread's context class loader, due to mockup services
    Installer.logDeactivated();
    //checkHandlers("After log deactivate", Logger.getLogger(Installer.UI_LOGGER_NAME));
    // setup the listing
    //installer.restored();
    File logs = File.createTempFile("autoSubmitLogs", ".xml");
    logs.deleteOnExit();
    String utf8 = 
        "<html><head>" +
        "<meta http-equiv='Content-Type' content='text/html; charset=utf-8'></meta>" +
        "</head>" +
        "<body>" +
        "<form action='file://"+logs.getAbsolutePath()+"' method='post'>" +
        "  <input name='submit' value='auto' type='hidden'> </input>" +
        "</form>" +
        "</body></html>";
    //ByteArrayInputStream is = new ByteArrayInputStream(utf8.getBytes("UTF-8"));
    MemoryURL.registerURL("memory://auto.html", utf8);
    //checkHandlers("After memory registry", Logger.getLogger(Installer.UI_LOGGER_NAME));
    
    Preferences prefs = NbPreferences.forModule(Installer.class);
    //checkHandlers("After Installer preferences loaded", Logger.getLogger(Installer.UI_LOGGER_NAME));
    prefs.putBoolean("autoSubmitWhenFull", true);
    //LogRecord r = new LogRecord(Level.INFO, "MSG_SOMETHING");
    //r.setLoggerName("org.netbeans.ui.anything");
    /*
    {
        Logger logger = Logger.getLogger("org.netbeans.ui.anything");
        while (logger != null) {
            Handler[] handlers = logger.getHandlers();
            System.err.println("Logger "+logger.getName()+" handlers = "+Arrays.asList(handlers));
            if (!logger.getUseParentHandlers()) {
                break;
            }
            logger = logger.getParent();
        }
    }
    */
    //checkHandlers("Before getLogsSizeTest()", Logger.getLogger(Installer.UI_LOGGER_NAME));
    int n1 = Installer.getLogsSizeTest();
    //checkHandlers("After getLogsSizeTest()", Logger.getLogger(Installer.UI_LOGGER_NAME));
    int n = UIHandler.MAX_LOGS + 1 - n1;
    //checkHandlers("Before logging loop", Logger.getLogger(Installer.UI_LOGGER_NAME));
    for (int i = 0; i < n; i++) {
        //Installer.writeOut(r);
        LogRecord r = new LogRecord(Level.INFO, "MSG_SOMETHING"+i);
        r.setLoggerName(Installer.UI_LOGGER_NAME + ".anything");
        Logger logger = Logger.getLogger(Installer.UI_LOGGER_NAME + ".anything");
        //System.err.println("handlers = "+Arrays.toString(handlers));
        //if (i == 0) {
        //    checkHandlers("Right before log", logger.getParent());
        //    checkHandlers("Begore log with main UI logger", Logger.getLogger(Installer.UI_LOGGER_NAME));
        //}
        logger.log(r);
    }
    UIHandler.waitFlushed();
    
    SwingUtilities.invokeAndWait(new Runnable() {
        @Override
        public void run() {
            // Empty just to get over the last scheduled task invoked in AWT.
        }
    });
    waitTillTasksInRPFinish(Installer.RP_SUBMIT);
    
    checkMessagesIn(logs, n);
    logs.delete();
}
 
開發者ID:apache,項目名稱:incubator-netbeans,代碼行數:76,代碼來源:AutoSubmitTest.java


注:本文中的org.openide.util.NbPreferences.forModule方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。