Package java.util.prefs

Examples of java.util.prefs.Preferences.clear()


     */
    public void save(Preferences preferences) {

        Preferences recentNode = preferences.node(SETTINGS_RECENT_WORKSPACES);
        try {
            recentNode.clear();
        } catch (BackingStoreException e) {
        }
        int count = 0;
        for (String fileName : recentWorkspaces) {
            recentNode.put(String.valueOf(count++), fileName);
View Full Code Here


                if (keywordsText.getText().trim().length() > 0) {
                    Preferences node = findNode(createdCRS.getName().getCode());
                    if (node != null) {
                        Preferences kn = node.node(ALIASES_ID);
                        String[] keywords = keywordsText.getText().split(","); //$NON-NLS-1$
                        kn.clear();
                        for( String string : keywords ) {
                            string = string.trim().toUpperCase();
                            if (string.length() > 0)
                                kn.put(string, string);
                        }
View Full Code Here

    protected void store() {
        Preferences prefs = getPreferences();

        // clear the backing store
        try {
            prefs.clear();
        } catch (BackingStoreException ex) {
        }

        for (int i = 0; i < gradients.size(); i++) {
            LinearGradient gradient = gradients.get(i);
View Full Code Here

    protected void store() {
        Preferences prefs = getPreferences();

        // clear the backing store
        try {
            prefs.clear();
        } catch (BackingStoreException ex) {
        }

        for (int i = 0; i < gradients.size(); i++) {
            LinearGradient gradient = gradients.get(i);
View Full Code Here

    protected void store() {
        Preferences prefs = getPreferences();

        // clear the backing store
        try {
            prefs.clear();
        } catch (BackingStoreException ex) {
        }

        for (int i = 0; i < mruFileList.size(); i++) {
            String str = mruFileList.get(i);
View Full Code Here

  public void testClear() {
    Preferences delegate = getRoot();
    Preferences prefs = getCPRoot();
    delegate.put("Foo", "Bar");
    try {
      prefs.clear();
      assertEquals("Baz", delegate.get("Foo", "Baz"));
    } catch (BackingStoreException e) {
      e.printStackTrace();
      fail();
    }
View Full Code Here

        addMessage("After in parent");
    }

    public static void clearMessages() throws BackingStoreException {
        Preferences prefs = Preferences.userNodeForPackage(BeforeAfterParent.class);
        prefs.clear();
        prefs.sync();
    }

    public static void addMessage(String message) {
        Preferences prefs = Preferences.userNodeForPackage(BeforeAfterParent.class);
View Full Code Here

  // save reports
  private static void saveReports() throws Exception {

    // clear and recreate reports node
    Preferences reportsPreferences = preferences.node("saved_reports");
    reportsPreferences.clear();

    // get reports to save
    Enumeration<ReportsModel.ReportTreeNode> e = BEViewer.reportsModel.elements();
    int i=0;
    while (e.hasMoreElements()) {
View Full Code Here

  // save bookmarks
  private static void saveBookmarks() throws Exception {

    // clear and recreate bookmarks node
    Preferences bookmarksPreferences = preferences.node("saved_bookmarks");
    bookmarksPreferences.clear();

    // get number of bookmarks to save
    int size = BEViewer.bookmarksModel.size();

    // save the bookmarks
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.