Examples of CategoryNode


Examples of com.ibm.sbt.playground.assets.CategoryNode

    return new RootNode();
  }
 
  @Override
  public CategoryNode createCategoryNode(CategoryNode parent, String name) {
    return new CategoryNode(parent, name);
  }
View Full Code Here

Examples of com.ibm.sbt.playground.assets.CategoryNode

    return new RootNode();
  }
 
  @Override
  public CategoryNode createCategoryNode(CategoryNode parent, String name) {
    return new CategoryNode(parent, name);
  }
View Full Code Here

Examples of com.ibm.sbt.playground.assets.CategoryNode

  protected void generateNodeFlat(JsonWriter jw, Node node) throws IOException {
    jw.startArrayItem();
      generateNodeEntryFlat(jw, node);
    jw.endArrayItem();
    if(node instanceof CategoryNode) {
      CategoryNode cn = (CategoryNode)node;
      List<Node> children = cn.getChildren();
      for(Node c: children) {
        generateNodeFlat(jw, c);
      }
    }
  }
View Full Code Here

Examples of com.ibm.sbt.playground.assets.CategoryNode

              jw.outStringLiteral((node).getJspUrl());
            jw.endProperty();
          }
        }
        if(node instanceof CategoryNode) {
          CategoryNode cn = (CategoryNode)node;
          List<Node> children = cn.getChildren();
          if(!children.isEmpty()) {
            jw.startProperty("children");
              jw.startArray();
                for(Node c: children) {
                  generateNodeHier(jw, c);
                }
              jw.endArray();
            jw.endProperty();
          }
        }
      jw.endArrayItem();
      jw.endObject();
    } else {
      if(node instanceof CategoryNode) {
        CategoryNode cn = (CategoryNode)node;
        List<Node> children = cn.getChildren();
        for(Node c: children) {
          generateNodeHier(jw, c);
        }
      }
    }
View Full Code Here

Examples of com.ibm.sbt.playground.assets.CategoryNode

    return src;
  }
  protected int importAssets(ImportSource source, VFSFile root, Node node, final AsyncAction action) throws Exception {
    int count=0;
    if(node.isCategory()) {
      CategoryNode cn=(CategoryNode) node;
      // Browse recursively...
      List<Node> children=cn.getChildren();
      for(Node n : children) {
        count+=importAssets(source, root, n, action);
      }
    } else if(node.isAsset()) {
      if(action!=null) {
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.CategoryNode

  protected void writeExcel(List<YKDocument> documents, File file, CategoryNode node, int winsize) throws Exception {
    final List<YKDocument> docs = documents;
    final File outputFile = file;
    final FileOutputStream stream = new FileOutputStream(outputFile);       
    final CategoryNode catnode = node;
    final YKDictionary dict = yoshikoder.getDictionary();
    final int wsize = winsize;
   
    tworker = new TaskWorker(yoshikoder){
      protected void doWork() throws Exception {
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.CategoryNode

  protected void writeCsvUTF8(List<YKDocument> documents, File file, CategoryNode node, int winsize) throws Exception {
    final List<YKDocument> docs = documents;
    final BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file),
        Charset.forName("UTF8")));
    final CategoryNode catnode = node;
    final YKDictionary dict = yoshikoder.getDictionary();
    final int wsize = winsize;
   
    tworker = new TaskWorker(yoshikoder){
      protected void doWork() throws Exception {
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.CategoryNode

  public void actionPerformed(ActionEvent e) {
    if (yoshikoder.getProject().getDocumentList().size() > 1){

      Node n = yoshikoder.getSelectedNode();
      CategoryNode cnode = null;
      if (n instanceof CategoryNode)
        cnode = (CategoryNode)n;
      else // patternnode
      cnode = (CategoryNode)n.getParent();
      final CategoryNode catnode = cnode;

      File file;
      try {
        int resp = chooser.showSaveDialog(yoshikoder);
        if (resp != JFileChooser.APPROVE_OPTION)
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.CategoryNode

 
  @Override
  public void actionPerformed(ActionEvent e) {
    Node node = yoshikoder.getSelectedNode();
    YKDictionary dict = yoshikoder.getDictionary();
    CategoryNode cnode = null;
    if (node instanceof CategoryNode)
      cnode = (CategoryNode)node;
    else
      cnode = (CategoryNode)node.getParent();
   
    if (area == null){
      area = new JTextArea(20,30);
      area.setEditable(true);
      area.setBorder(BorderFactory.createEmptyBorder(2, 2, 2, 2));
      area.setDropMode(DropMode.INSERT);
      area.setLineWrap(true);
      area.setWrapStyleWord(true);
    } else {
      area.setText("");
    }
   
    JScrollPane pane = new JScrollPane(area);
    int resp = JOptionPane.showConfirmDialog(yoshikoder, pane, "Add patterns to " + cnode.getName(),
      JOptionPane.OK_CANCEL_OPTION, JOptionPane.PLAIN_MESSAGE);
    if (resp != JOptionPane.OK_OPTION)
      return;
   
    String str = area.getText();
    String[] spl = str.split("[^\\w]+");
    List<String> errors = new ArrayList<String>();
    for (int ii = 0; ii < spl.length; ii++) {
      String newpat = spl[ii];
      try {
        dict.addPattern(spl[ii], null, cnode);
      } catch (DuplicateException dex){
        // quietly supress duplicates
      } catch (Exception ex){
        errors.add(spl[ii]);
      }
    }
    yoshikoder.setSelectedNode(cnode);
   
    if (errors.size() > 0){
      StringBuffer sb = new StringBuffer();
      sb.append("There were some problems adding the patterns:\n\n");
      for (Iterator iterator = errors.iterator(); iterator.hasNext();) {
        String string = (String) iterator.next();
        sb.append(string);
        sb.append(" ");
      }
      sb.append("\nThis is usually because " +
          "a dictionary entry of the same name already exists.");
     
      area.setText(sb.toString());
      JOptionPane.showMessageDialog(yoshikoder, new JScrollPane(area), "Error adding patterns to " + cnode.getName(),
        JOptionPane.PLAIN_MESSAGE);
    }
  }
View Full Code Here

Examples of edu.harvard.wcfia.yoshikoder.dictionary.CategoryNode

    public void actionPerformed(ActionEvent e) {
        Node node = yoshikoder.getSelectedNode();
        if (node != null){
            if (node instanceof CategoryNode) {
                CategoryNode n = (CategoryNode)node;
                JDialog dia =
                    new EditCategoryDialog(yoshikoder, (CategoryNode)n.getParent(), n);
                dia.show();
               
            } else if (node instanceof PatternNode) {
                PatternNode n = (PatternNode)node;
                JDialog dia =
                    new EditPatternDialog(yoshikoder, (CategoryNode)n.getParent(), n);
                dia.show();
            }
        }
    }
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.