Examples of PromptDialog


Examples of com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.PromptDialog

     *
     * @see com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.ListEditor#getEditedInput(java.lang.String)
     */
    @Override
    protected String getEditedInput(String input) {
      PromptDialog dialog = new PromptDialog(getShell(), SWT.SHEET) {
        @Override
        protected boolean isValid(String text) {
          boolean result = true;
          if(text.contains(":")) {
            result = false;
            setErrorMessage("Colon ':' is not allowed");
          }
          else if(text.contains("//")) {
            result = false;
            setErrorMessage("Empty segment '//' not allowed");
          }
          return result;
        }
      };
      String[] value = new String[] { input };
      int[] allSubdirs = new int[] { input.endsWith("/*")
          ? 1
          : 0 };
      int[] okCancel = new int[] { 1 };

      dialog.prompt(
        "Edit Path Segement", "Edit relative path", "Search all subdirectories", value, allSubdirs, okCancel);
      if(okCancel[0] == 0)
        return input;
      String result = value[0].trim();
      if(allSubdirs[0] == 0) {
View Full Code Here

Examples of com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.PromptDialog

      return result;
    }

    @Override
    protected String getNewInputObject() {
      PromptDialog dialog = new PromptDialog(getShell(), SWT.SHEET) {
        @Override
        protected boolean isValid(String text) {
          boolean result = true;
          if(text.contains(":")) {
            result = false;
            setErrorMessage("Colon ':' is not allowed");
          }
          else if(text.contains("//")) {
            result = false;
            setErrorMessage("Empty segment '//' not allowed");
          }
          return result;
        }
      };
      String[] value = new String[] { "" };
      int[] allSubdirs = new int[] { 1 };
      int[] okCancel = new int[] { 1 };

      dialog.prompt(
        "Add Path Segement", "Enter new relative path", "Search all subdirectories", value, allSubdirs,
        okCancel);
      if(okCancel[0] == 0)
        return null;
      if(allSubdirs[0] == 0)
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

    return -1;
  }

  private String getIp() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.ip), LanguageFactory.getInstance().getString(MessageId.whatIpDoYouWantToConnectTo), up.getIp(), false, 0, 255, -1);

    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));

    dialog.prompt();
    String ip = dialog.getValue();
    up.setIp(ip);
    new UserPreferencesManager().persist(up);
    return ip;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

    return ip;
  }

  private String getName() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

  public int bid(Card trump, int min, int max, int notAllowedToBid) {
    String suffix = "";
    if(notAllowedToBid > -1) {
      suffix = " (not allowed to bid " + notAllowedToBid + ") ";
    }
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.xsBid, "playerName", getName()), LanguageFactory.getInstance().getString(MessageId.whatDoYouWantToBid) + suffix, "", true, 0, round, notAllowedToBid);
    Point location = jFrame.getLocation();
    Dimension size = jFrame.getSize();
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    int bid = dialog.getIntValue();
    return bid;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

    this.numberOfPlayers = Integer.valueOf(numberOfPlayers);
  }

  private int getNumberOfPlayers() {
    if(numberOfPlayers == null) {
      PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.players), LanguageFactory.getInstance().getString(MessageId.howManyHumanPlayersDoYouWant), "", true, -1, 4, -2);
      Point location = new Point(0,0);
      Dimension size = new Dimension(900,720);
      Dimension dialogSize = dialog.getSize();
      dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
      dialog.prompt();
      return dialog.getIntValue();
    }

    return numberOfPlayers.intValue();
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

    return player;
  }

  private String getLocalName() {
    UserPreferences up = new UserPreferencesManager().load();
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

    }
    return -1;
  }

  private String getIp() {
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.ip), LanguageFactory.getInstance().getString(MessageId.whatIpDoYouWantToConnectTo), up.getIp(), false, 0, 255, -1);

    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));

    dialog.prompt();
    String ip = dialog.getValue();
    up.setIp(ip);
    new UserPreferencesManager().persist(up);
    return ip;
  }
View Full Code Here

Examples of com.svanloon.game.wizard.human.dialog.PromptDialog

    new UserPreferencesManager().persist(up);
    return ip;
  }

  private String getName() {
    PromptDialog dialog = new PromptDialog(LanguageFactory.getInstance().getString(MessageId.name), LanguageFactory.getInstance().getString(MessageId.whatsYourName), up.getName(), false, 0, 255, -1);
    Point location = new Point(0,0);
    Dimension size = new Dimension(900,720);
    Dimension dialogSize = dialog.getSize();
    dialog.setLocation((int)(location.getX() + size.getWidth() / 2.0 - dialogSize.getWidth() / 2.0), (int)(location.getY() + size.getHeight()/2.0 - dialogSize.getHeight()/2.0));
    dialog.prompt();
    String name = dialog.getValue();
    up.setName(name);
    new UserPreferencesManager().persist(up);
    return name;
  }
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.