Package us.thinkable.framework.editor

Examples of us.thinkable.framework.editor.XTableEditor


    String file = XUtil.readFile(new File("resources/framework.menu"));
    readPanel.setText(file);

    statusPanel = new XStatusEditor(frame, "Status", null);

    tablePanel = new XTableEditor(frame, "Table", null);
    tablePanel.setData(columnNames, data);

    // create the example panel
    examplePanel = new ExamplePanel(frame, "Example", null);
View Full Code Here


    this.add(button);
  }

  public void actionPerformed(ActionEvent e) {
    XStatusEditor statusPanel = (XStatusEditor) Main.statusPanel;
    XTableEditor tablePanel = (XTableEditor) Main.tablePanel;
    if ("log".equals(e.getActionCommand())) {
      statusPanel.addText("Button Clicked");
    } else if ("popup".equals(e.getActionCommand())) {
      int response = 0;
      response = XDialog.alert("Message", "OK");
      statusPanel.addText("" + response);

      response = XDialog.info("Message", "OK", "Cancel");
      statusPanel.addText("" + response);

      response = XDialog.warning("Message", "OK", "Cancel", "Other");
      statusPanel.addText("" + response);

      response = XDialog.error("Message", "OK", "Cancel", "Other", "Wow!");
      statusPanel.addText("" + response);

      String result = "";
      result = XDialog.input("Message", "OK", "Cancel");
      statusPanel.addText(result);

      result = XDialog.input("Message");
      statusPanel.addText(result);

      String[] imageExts = { "jpg", "png", "bmp" };
      String file = XDialog.load("Load", null, imageExts);
      statusPanel.addText("LOAD:" + file);

      file = XDialog.save("Save", null, imageExts);
      statusPanel.addText("SAVE:" + file);

      file = XDialog.directory("Directory");
      statusPanel.addText("DIRECTORY:" + file);

    } else if ("table".equals(e.getActionCommand())) {
      Object[][] data = tablePanel.getData();
      for (int i = 0; i < data.length; i++) {
        Object[] row = data[i];
        String s = "row(" + i + "):";
        for (int j = 0; j < row.length; j++) {
          Object obj = row[j];
          s += obj + "(" + obj.getClass().getName() + ") ";
        }
        statusPanel.addText(s);
        tablePanel.toFront();
      }
    } else if ("trek".equals(e.getActionCommand())) {
      tablePanel.setData(headers, data);
      tablePanel.setEditable(false);
      tablePanel.toFront();
    }
  }
View Full Code Here

TOP

Related Classes of us.thinkable.framework.editor.XTableEditor

Copyright © 2018 www.massapicom. 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.