Package com.subhajit.gui.form

Examples of com.subhajit.gui.form.BindingEditor


    final String className = (String) ctx.get("class");
    final URLClassLoader classLoader = ProjectUtils.getClassLoader(
        (IJavaProject) ctx.get("project"), true);

    // Ask the user what type of class diagram the user wants.
    BindingEditor editor = new BindingEditor(
        new BindingSpec[] {
            new BindingSpec.BindingSpecBuilder()
                .setLabel("Class diagram type")
                .setName("type")
                .setTooltip(
                    "\"Simple\" generates only this class, its ancestors and its subclasses. \"Connected\" generates all descendants of all ancestors.")
                .setValue(
                    new String[] {
                        ClassDiagramType.Simple
                            .toString()
                            + " - This class, its sub-classes and its descendants.",
                        ClassDiagramType.Connected
                            .toString()
                            + " - This class, its ancestors, and all of their descendants.",
                        ClassDiagramType.Related
                            .toString()
                            + " - This class and all its related classes, each in a separate diagram." })
                .createBindingSpec(),
            new BindingSpec.BindingSpecBuilder().setLabel(
                "Show methods").setName("setMethods")
                .setTooltip("Show methods").setValue(
                    Boolean.TRUE).createBindingSpec() });
    SwtDialog.newDialog(editor, "Class Diagram", -1, -1);
    Map<String, Object> userInputs = editor.getEditedValues();
    if (userInputs == null) {
      // The user canceled out of the dialog.
      return;
    }
View Full Code Here


      } else {
        break;
      }
    }

    BindingEditor editor = new BindingEditor(specs
        .toArray(new BindingSpec[0]));
    for (String disableControlName : disabledControlNames) {
      JComponent component = editor.getEditorComponents().get(
          disableControlName);
      component.setEnabled(false);
      for (int i = 0; i < component.getComponentCount(); i++) {
        component.getComponent(i).setEnabled(false);
      }
    }
    JDialog dialog = Dialog.newDialog(editor);
    dialog.setModal(true);
    dialog.setVisible(true);
    Map<String, Object> editedValues = editor.getEditedValues();
    for (Map.Entry<String, Object> entry : editedValues.entrySet()) {
      final String fieldName = entry.getKey();
      final Field field = fieldMap.get(fieldName);
      field.setAccessible(true);
      Object value = entry.getValue();
View Full Code Here

        String mainClass = null;
        boolean stripJars = false;
        String[] mainClassArray = mainClasses
            .toArray(IConstants.ZERO_LENGTH_STRING_ARRAY);
        if (mainClassArray.length > 0) {
          BindingEditor editor = new BindingEditor(
              new BindingSpec[] {
                  new BindingSpec.BindingSpecBuilder()
                      .setLabel("Main class").setName(
                          EditorKeys.mainClass
                              .toString())
                      .setTooltip("Main class").setValue(
                          mainClassArray)
                      .createBindingSpec(),
                  new BindingSpec.BindingSpecBuilder()
                      .setLabel("Remove unused classes")
                      .setName(
                          EditorKeys.strip.toString())
                      .setTooltip(
                          "Remove classes not used by main class")
                      .setValue(false)
                      .createBindingSpec() });
          SwtDialog.newDialog(editor, "", 600, 400);
          Map<String, Object> editedValues = editor.getEditedValues();
          if (editedValues != null) {
            mainClass = (String) editedValues
                .get(EditorKeys.mainClass.toString());
            stripJars = (Boolean) editedValues.get(EditorKeys.strip
                .toString());
View Full Code Here

  public static Map<String, Object> getCompileCodeLevels() {
    CodeLevel[] ret = new CodeLevel[2];
    ret[0] = CodeLevel.ONE_FIVE;
    ret[1] = CodeLevel.ONE_SIX;

    BindingEditor editor = new BindingEditor(new BindingSpec[] {
        new BindingSpec.BindingSpecBuilder().setLabel("Output type")
            .setName(InputKeys.jarType.toString()).setTooltip(
                "Thin jar").setValue(
                new String[] { JarType.Thin.toString(),
                    JarType.Fat.toString() })
            .createBindingSpec(),
        new BindingSpec.BindingSpecBuilder().setLabel("Source level")
            .setName(InputKeys.sourceLevel.toString()).setTooltip(
                "Source code level").setValue(
                new String[] { CodeLevel.ONE_FIVE.toString(),
                    CodeLevel.ONE_SIX.toString() })
            .createBindingSpec(),
        new BindingSpec.BindingSpecBuilder().setLabel("Target level")
            .setName(InputKeys.targetLevel.toString()).setTooltip(
                "Target code level").setValue(
                new String[] { CodeLevel.ONE_FIVE.toString(),
                    CodeLevel.ONE_SIX.toString() })
            .createBindingSpec() });
    SwtDialog.newDialog(editor, "", 600, 400);
    return editor.getEditedValues();
    // if (editor.getEditedValues() != null) {
    // ret[0] = CodeLevel.valueOf((String) editor.getEditedValues().get(
    // CodeLevelDialogKeys.sourceLevel.toString()));
    // ret[1] = CodeLevel.valueOf((String) editor.getEditedValues().get(
    // CodeLevelDialogKeys.targetLevel.toString()));
View Full Code Here

  private void generateClassDiagram(final URLClassLoader classLoader,
      final String className) {
    // Ask the user what type of class diagram they want.
    // Ask the user what type of class diagram the user wants.
    BindingEditor editor = new BindingEditor(
        new BindingSpec[] {
            new BindingSpec.BindingSpecBuilder()
                .setLabel("Class diagram type")
                .setName("type")
                .setTooltip(
                    "\"Simple\" generates only this class, its ancestors and its subclasses. \"Connected\" generates all descendants of all ancestors.")
                .setValue(
                    new String[] {
                        ClassDiagramType.Simple
                            .toString()
                            + " - This class, its sub-classes and its descendants.",
                        ClassDiagramType.Connected
                            .toString()
                            + " - This class, its ancestors, and all of their descendants.",
                        ClassDiagramType.Related
                            .toString()
                            + " - This class and all its related classes, each in a separate diagram." })
                .createBindingSpec(),
            new BindingSpec.BindingSpecBuilder().setLabel(
                "Show methods").setName("setMethods")
                .setTooltip("Show methods").setValue(
                    Boolean.TRUE).createBindingSpec() });
    JDialog dialog = Dialog.newDialog(editor);
    dialog.setModal(true);
    dialog.setVisible(true);

    Map<String, Object> editedValues = editor.getEditedValues();
    String type = (String) editedValues.get("type");
    if (type == null) {
      return;
    }
View Full Code Here

TOP

Related Classes of com.subhajit.gui.form.BindingEditor

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.