Пример #1
0
  public static Vector extractKeywordFromText(String text) {
    // see if there are any existing keywords represented
    // in this text
    // Get all keywords

    Vector extractedKeywords = new Vector();
    Iterator keywords = allKeywords.iterator();
    while (keywords.hasNext()) {
      Keyword keyword = (Keyword) keywords.next();
      if (text != null
          && keyword.toString() != null
          && text.toLowerCase().indexOf(keyword.toString().toLowerCase()) > -1) {
        extractedKeywords.addElement(keyword);
      }
    }
    return extractedKeywords;
  }
Пример #2
0
 public static EnumDefinition dropKeywordCreateEnum(
     EnumDefinition enumDefinition, Keyword keyword, boolean saveEnum) {
   if (enumDefinition == null) {
     enumDefinition = new EnumDefinition(keyword.toString(), saveEnum);
   }
   enumDefinition.setKeyword(keyword);
   return enumDefinition;
 }
 public UndefinedBooleanExpressionPanel(UndefinedBooleanExpression expr) {
   setLayout(new FlowLayout(FlowLayout.LEFT));
   setBackground(Color.white);
   // setBorder
   //		 (BorderFactory.createLineBorder(Color.red,
   //																								2));
   if (expr.getLeftHandSide() instanceof Keyword
       && expr.getRightHandSide() instanceof EnumLevelList) {
     Keyword keyword = (Keyword) expr.getLeftHandSide();
     EnumLevelList ll = (EnumLevelList) expr.getRightHandSide();
     // System.out.println("keyword " + keyword);
     JLabel keywordLabel = new JLabel(keyword.toString() + ARROW);
     // keywordLabel.setFont(new Font("Arial",10,Font.BOLD));
     add(keywordLabel);
     if (ll.isNumericList()) add(getNumericLevels(ll));
     else add(getStringLevels(ll));
   } else add(new JLabel("Improperly defined boolean expression"));
 }
Пример #4
0
 public static EnumDefinition dropKeywordCreateEnum(Keyword keyword, boolean saveEnum) {
   EnumDefinition enumDefinition = new EnumDefinition(keyword.toString(), saveEnum);
   enumDefinition.setKeyword(keyword);
   return enumDefinition;
 }