Examples of UIRequest_String


Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

                                                         str("inputPrefix"),
                                                         str("inputCategory"),
                                                         str("inputLinkingTo"),
                                                         str("inputUsingImage"),
                                                         str("inputEmbeddingTemplate")}));
      requestList.add(new UIRequest_String("name", str("inputName"), str("helpInputName")));
     
      for (int i = 0; i < restrictionsInArticleSelection; i++ ) {
        requestList.add(new UIRequest_Selection(
            "restriction_type_" + i,
            str("restrictionType", (i+1)),
            str("helpRestrictionType"),
            0,
            new String[]{str("restrictionNone"),
                       str("inputFrom"),
                         str("inputPrefix")}));
        requestList.add(new UIRequest_String(
            "restriction_value_" + i,
            str("restrictionValue", (i+1)),
            str("helpRestrictionValue")));
      }     
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

       
        int selectedURLIndex = indexOfUrlInURLStringArray(conf_wikiURLs, text.getWikiURL());
       
        UIRequest[] overviewRequestArray = new UIRequest[] {
            new UIRequest_Selection("url", str("mediaWikiWrite"), str("helpMediaWikiWrite"), selectedURLIndex, wikiURLs),
            new UIRequest_String("label", str("articleName"), str("helpArticleName"), text.getLabel()),
            new UIRequest_String("text", str("articleText"), str("helpArticleText"), text.getText(),multipleLines,lineWrap),
            new UIRequest_String("summary", str("summary"), str("helpSummary"), text.getEditSummary()),
            new UIRequest_Boolean("minor", str("minor"), str("helpMinor"), text.isMinorEdit())
        };
         
        NamedDataSet overviewReply = uiForRequests.request(overviewRequestArray);
         
        if ( overviewReply == null ) {
          text = null;
          completed = true;
        } else {         
         
          try {
            createBot(conf_wikiURLs[overviewReply.<Integer>get("url")]);
           
            text.setLabel(overviewReply.<String>get("label"));
            text.setText(overviewReply.<String>get("text"));
            text.setEditSummary(overviewReply.<String>get("summary"));
            text.setMinorEdit(overviewReply.<Boolean>get("minor"));
             
            completed = true;
           
          } catch (MalformedURLException e) {
            uiForRequests.request(
                new UIRequest_Output(
                    str("errorMalformedURL", e.getMessage())));
          } catch (NamedDataNotAvailableException e) {       
            uiForRequests.request(new UIRequest_Output(str("errorUserInput")));
          }
         
        }
       
      }
     
    } else {

      if (text.getWikiURL() != null) {
        try {
          createBot(text.getWikiURL().toString());         
        } catch (MalformedURLException e) {
          //do nothing, user will be asked
        }
      }
     
      if (bot == null || alwaysAskForOutputWiki) {
       
        int selectedURLIndex = indexOfUrlInURLStringArray(wikiURLs, text.getWikiURL());
       
        UIRequest[] requestArray = new UIRequest[] {
            new UIRequest_Selection("url", str("mediaWikiWrite"), str("helpMediaWikiWrite"), selectedURLIndex, conf_wikiURLs)
        };
       
        NamedDataSet reply = uiForRequests.request(requestArray);
       
        try {
          createBot(conf_wikiURLs[reply.<Integer>get("url")]);
        } catch (MalformedURLException e) {
          uiForRequests.request(
              new UIRequest_Output(
                  str("errorMalformedURL", e.getMessage())));
        } catch (NamedDataNotAvailableException e) {       
          uiForRequests.request(new UIRequest_Output(str("errorUserInput")));
        }
       
      }
     
    }
     
    /* write the article to the wiki (after logging in) */
     
    if( text != null ){   
     
      /*
       * if the bot is not logged in,
       * but all information is available to log in, do so
       */
       
      if( !bot.isLoggedIn()
          && username != null && !username.equals("")
          && password != null ){         
         
        try {
          bot.login(username, password);
        } catch (ActionException e) {
          /* the "Login failed" message will be printed */         
        }
         
        if ( !bot.isLoggedIn() && !password.equals("") ) {
          uiForRequests.request(
              new UIRequest_Output(str("errorLoginFailed")) );       
       
           
      }
       
      /*
       * if bot (still) not logged in, ask for username and password
       * until the bot is logged in or the user gives up
       */
       
      boolean tryAgain = true;
   
      while( !bot.isLoggedIn() && tryAgain ){
                       
        UIRequest requestArray[] = {
          new UIRequest_String("username", str("username"),
              str("helpUsername"), username),
          new UIRequest_String("password", str("password"),
              str("helpPassword"),
              UIRequest_String.LayoutFlag.hideInput)
        };
       
        NamedDataSet reply = uiForRequests.request(requestArray);
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

      if (replacements == null
          || replacements.size() == 0
          || !( replacements.get(0) instanceof RegExReplacement ) ) {
       
        requestArray = new UIRequest[] {
          new UIRequest_String("regex", str("searchFor"), str("helpSearchFor")),
          new UIRequest_String("rwith", str("replaceWith"), str("helpReplaceWith")),
          new UIRequest_String("summary", str("summary"), str("helpSummary"), defaultSummary),
          new UIRequest_Boolean("ask", str("ask"), str("helpAsk"), confirmChangesByDefault),
          new UIRequest_Output(str("help"))
        };
       
      } else {
       
        RegExReplacement rep = (RegExReplacement)replacements.get(0);
        requestArray = new UIRequest[] {
          new UIRequest_String("regex", str("searchFor"), str("helpSearchFor"), rep.regex),
          new UIRequest_String("rwith", str("replaceWith"), str("helpReplaceWith"), rep.rwith),
          new UIRequest_String("summary", str("summary"), str("helpSummary"), summary),
          new UIRequest_Boolean("ask", str("ask"), str("helpAsk"), rep.rating > 0),
          new UIRequest_Output(str("help"))
        };
       
      }     
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

    String text = new String();
   
    //ask for input
   
    UIRequest request =
      new UIRequest_String("input",
                       str("inputText"),
                       str("helpInputText"),
                       multipleLines);
   
    NamedDataSet reply = uiForRequests.request(request);
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

   * It is used if none of the more specialized methods can be used for the given text.
   */ 
  private void outputEditableText(EditableText text, UIComponent uiForRequests){ 
   
    UIRequest[] requestArray = new UIRequest[] {
      new UIRequest_String(null,
                       str("name"),
                       str("helpName"),
                       text.getLabel()),
      new UIRequest_String(null,
                       str("text"),
                       str("helpText"),
                       text.getText(),
                       multipleLines, lineWrap)
    };
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

   * this method will be used.
   */
  private void outputMediaWikiText(MediaWikiText text, UIComponent uiForRequests){ 
   
    UIRequest[] requestArray = new UIRequest[] {
      new UIRequest_String(null,
                       str("articleName"),
                       str("helpArticleName"),
                       text.getLabel()),
      new UIRequest_String(null,
                       str("articleText"),
                       str("helpArticleText"),
                       text.getText(),
                       multipleLines, lineWrap),
      new UIRequest_String(null,
                       str("summary"),
                       str("helpSummary"),
                       text.getEditSummary()),
      new UIRequest_Boolean(null,
                        str("minor"),
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

           
            break;   

          case Request_String:
   
            UIRequest_String stringRequest = (UIRequest_String)request;
                       
            //create the text field / password field / text area (depending on the flags)
           
            JTextComponent textComponentStringRequest;
           
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

   
    String inputFileName = null;
   
    while (inputFileName == null) {
   
      NamedDataSet reply = uiForRequests.request(new UIRequest_String(
          "path", str("titleInputFilePath"), str("helpInputFilePath"),
          UIRequest_String.LayoutFlag.readPath));
     
      if (reply == null) {
        return null; //cancelled - #### !! return-point !! ####
View Full Code Here

Examples of net.sf.jeters.componentInterface.dataStructs.UIRequest_String

      while (outputFileName == null && tryAgain) {
     
        //get the path from user interface
       
        NamedDataSet reply = uiForRequests.request(new UIRequest_String(
            "path", str("titleOutputFilePath"),
            str("helpOutputFilePath"),
            UIRequest_String.LayoutFlag.writePath));
       
        if (reply == null) { tryAgain = false; } //cancelled
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.