Examples of ApplicationPreferences


Examples of anvil.server.ApplicationPreferences

  /// Returns a named property from <code>application</code> configuration
  /// section, or <code>undefined</code> if property does not exist.
  /// @synopsis string getProperty(string propertyName)
  public static final Any getProperty(Context context, String property)
  {
    ApplicationPreferences app = context.address().getZone().getApplicationPreferences();
    return (app != null) ?
      Any.create(app.getPreference(property)) : Any.UNDEFINED;
  }
View Full Code Here

Examples of anvil.server.ApplicationPreferences

  /// <code>application</code> configuration section.
  /// @synopsis array getProperties()
  public static final Any getProperties(Context context)
  {
    Array props = new Array();
    ApplicationPreferences app = context.address().getZone().getApplicationPreferences();
    if (app != null) {
      String[] names = app.getAdditionalPreferenceNames();
      final int n = names.length;
      for(int i=0; i<n; i++) {
        props.put(new AnyString(names[i]), Any.create(app.getPreference(names[i])));
      }
    }
    return props;
  }
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

        }
        viewer.open(getWindow().getFrame());
    }

    private void createViewer() {
        ApplicationPreferences prefs = ApplicationUi.getPreferences();
        viewer = new PreferencesViewer(prefs);
        if (initialPath != null) {
            viewer.setInitialPath(initialPath);
        }
    }
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

    public static void main(String[] args) {
        new PreferencesViewerTest().run();
    }

    public void run() {
        ApplicationPreferences prefs = createPreferences();
        PreferencesViewer viewer = new PreferencesViewer(prefs);
        viewer.open(null);
    }
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

        PreferencesViewer viewer = new PreferencesViewer(prefs);
        viewer.open(null);
    }
   
    private ApplicationPreferences createPreferences() {
        ApplicationPreferences prefs = new ApplicationPreferences();
        prefs.addPage(new PathOnlyPage("General"));
        prefs.addPage(new PathOnlyPage("Cache"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets"));
        prefs.addPage(new LocationCachePage("Http"));
        prefs.addPage(new LocationCachePage("Database"));
        prefs.addPage(new LocationCachePage("General"));
        prefs.addPage(new PathOnlyPage("Wizards"));
        return prefs;
    }
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

        });
        QuickFrame.show(new JScrollPane(tree), getClass().getSimpleName());
    }
   
    private TreeModel createTreeModel() {
        ApplicationPreferences prefs = new ApplicationPreferences();
        prefs.addPage(new PathOnlyPage("General"));
        prefs.addPage(new PathOnlyPage("Cache"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Http"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Database"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "General"));
        prefs.addPage(new PathOnlyPage("Wizards"));
        ApplicationPreferences.Node root = prefs.getRoot();
        return new PreferencesTreeModel(root);
    }
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

*/
public class ApplicationPreferencesJUnitTest {

    @Test(expected= DuplicateNodeException.class)
    public void testDuplicatePathDetection() {
        ApplicationPreferences prefs = new ApplicationPreferences();
        prefs.addPage(new PathOnlyPage("General"));
        prefs.addPage(new PathOnlyPage("Cache"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Http"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Ftp"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Ftp"));
    }
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Ftp"));
    }
   
    @Test
    public void testNodeTree() {
        ApplicationPreferences prefs = new ApplicationPreferences();
        prefs.addPage(new PathOnlyPage("General"));
        prefs.addPage(new PathOnlyPage("Cache"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Http"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Database"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "General"));
        prefs.addPage(new PathOnlyPage("Wizards"));
        ApplicationPreferences.Node root = prefs.getRoot();
        ApplicationPreferences.Node[] children = root.getChildren();
        assertEquals(children.length, 3);
        assertEquals(children[0].getName(), "General");
        assertEquals(children[0].getChildren().length, 0);
        assertEquals(children[1].getName(), "Cache");
View Full Code Here

Examples of org.jitterbit.application.ui.prefs.ApplicationPreferences

        assertEquals(children[2].getChildren().length, 0);
    }
   
    @Test
    public void testNodePaths() {
        ApplicationPreferences prefs = new ApplicationPreferences();
        prefs.addPage(new PathOnlyPage("Cache"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets"));
        prefs.addPage(new PathOnlyPage("Cache", "Sources & Targets", "Http"));
        ApplicationPreferences.Node root = prefs.getRoot();
        ApplicationPreferences.Node cache = root.getChildren()[0];
        assertArrayEquals(cache.getPath(), new String[] { "Cache" });
        ApplicationPreferences.Node sourcesAndTargets = cache.getChildren()[0];
        assertArrayEquals(sourcesAndTargets.getPath(), new String[] { "Cache", "Sources & Targets" });
        ApplicationPreferences.Node http = sourcesAndTargets.getChildren()[0];
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.