コード例 #1
0
 public void init() {
   // create connection information
   ci.setHost("srumpf-work");
   ci.setDomain("");
   ci.setUser("Administrator");
   ci.setPassword("Admin");
   ci.setClsid("F8582CF2-88FB-11D0-B850-00C0F0104305");
   itemId = "Saw-toothed Waves.Int2";
   // create a new server
   server = new Server(ci, Executors.newSingleThreadScheduledExecutor());
 }
  public TreeBrowserTopComponent() {
    initComponents();
    setName(Bundle.CTL_TreeBrowserTopComponent());
    setToolTipText(Bundle.HINT_TreeBrowserTopComponent());

    associateLookup(ExplorerUtils.createLookup(explorerManager, getActionMap()));
    explorerManager.setRootContext(new ServersNode(getServersChildren()));

    ConnectionInformation info = new ConnectionInformation();
    info.setDomain("");

    if (INSTANCE == null) {
      INSTANCE = this;
    }
  }
 void readProperties(java.util.Properties p) {
   String version = p.getProperty("version");
   // TODO read your settings according to their version
   if (version != null && version.equals(PROPERTY_VERSION)) {
     List<ConnectionInformation> connections = new ArrayList<ConnectionInformation>();
     int count = Integer.valueOf(p.getProperty(NUM_CONNECTION_KEY, "0"));
     for (int i = 0; i < count; i++) {
       ConnectionInformation connInfo = new ConnectionInformation();
       connInfo.setClsid(p.getProperty(CLS_ID_KEY + "." + i + "." + PROPERTY_VERSION, "ERROR"));
       connInfo.setProgId(p.getProperty(PROG_ID_KEY + "." + i + "." + PROPERTY_VERSION, "ERROR"));
       connInfo.setUser(p.getProperty(USER_KEY + "." + i + "." + PROPERTY_VERSION, "ERROR"));
       connInfo.setHost(p.getProperty(HOST_KEY + "." + i + "." + PROPERTY_VERSION, "ERROR"));
       connInfo.setDomain(p.getProperty(DOMAIN_KEY + "." + i + "." + PROPERTY_VERSION, "ERROR"));
       connInfo.setPassword(
           p.getProperty(PASSWORD_KEY + "." + i + "." + PROPERTY_VERSION, "ERROR"));
       connections.add(connInfo);
     }
     serversChildren.setConnections(connections);
   }
 }