Package com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors

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


      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

TOP

Related Classes of com.puppetlabs.geppetto.pp.dsl.ui.preferences.editors.PromptDialog

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.