Package org.freeplane.features.filter.condition

Examples of org.freeplane.features.filter.condition.ASelectableCondition


      parent.remove(editor);
    }
    if (run != JOptionPane.OK_OPTION) {
      return;
    }
    final ASelectableCondition condition = editor.getCondition();
    findFirst(condition);
  }
View Full Code Here


    this.filterController = filterController;
    this.filterEditor = quickEditor;
  }

  public void actionPerformed(final ActionEvent e) {
    final ASelectableCondition condition = filterEditor.getCondition();
    if(condition == null){
      return;
    }
    filterController.apply(condition);
  }
View Full Code Here

    this.direction =direction ;
  }

  public void executeAction(final boolean reFocusSearchInputField)
  {
    final ASelectableCondition condition = filterEditor.getCondition();
    if(condition == null){
      return;
    }
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    if(selection == null){
View Full Code Here

    pathToFilterFile = ResourceController.getResourceController().getFreeplaneUserDirectory() + File.separator
            + "auto." + FilterController.FREEPLANE_FILTER_EXTENSION_WITHOUT_DOT;
  }

  private void addStandardConditions() {
    final ASelectableCondition noFiltering = NO_FILTERING;
    filterConditions.insertElementAt(noFiltering, 0);
    if (selectedViewCondition == null) {
      selectedViewCondition = SelectedViewCondition.CreateCondition();
    }
    filterConditions.insertElementAt(selectedViewCondition, 1);
View Full Code Here

      activeFilterConditionComboBox.setEnabled(false);
    }
  }

  void applyFilter(final boolean force) {
    final ASelectableCondition selectedCondition = getSelectedCondition();
    final Filter filter = createFilter(selectedCondition);
    final ICondition condition = filter.getCondition();
    if(condition != selectedCondition && condition instanceof ASelectableCondition)
      getFilterConditions().setSelectedItem(condition);
    else
View Full Code Here

  public void beforeMapChange(final MapModel oldMap, final MapModel newMap) {
  }

  private Filter createFilter(final ASelectableCondition selectedCondition) {

    final ASelectableCondition filterCondition;
    if (selectedCondition == null || selectedCondition.equals(NO_FILTERING)) {
      filterCondition = null;
    }
    else if (selectedCondition instanceof ConditionSnapshotFactory) {
      filterCondition =  ((ConditionSnapshotFactory)selectedCondition).createSnapshotCondition();
View Full Code Here

      parser.setReader(reader);
      reader.setSystemID(filterFile.toURL().toString());
      final XMLElement loader = (XMLElement) parser.parse();
      final Vector<XMLElement> conditions = loader.getChildren();
      for (int i = 0; i < conditions.size(); i++) {
        final ASelectableCondition condition = getConditionFactory().loadCondition(conditions.get(i));
        if(condition != null){
          filterConditionModel.addElement(condition);
        }
      }
    }
View Full Code Here

          throws IOException {
    final XMLElement saver = new XMLElement();
    saver.setName("filter_conditions");
    final Writer writer = new FileWriter(pathToFilterFile);
    for (int i = 0; i < filterConditionModel.getSize(); i++) {
      final ASelectableCondition cond = (ASelectableCondition) filterConditionModel.getElementAt(i);
      if (cond != null && !(cond instanceof NoFilteringCondition)) {
        cond.toXml(saver);
      }
    }
    final XMLWriter xmlWriter = new XMLWriter(writer);
    xmlWriter.write(saver, true);
    writer.close();
View Full Code Here

    this.filterController = filterController;
    this.filterEditor = quickEditor;
  }

  public void actionPerformed(final ActionEvent e) {
    final ASelectableCondition condition = filterEditor.getCondition();
    if(condition == null){
      return;
    }
    final IMapSelection selection = Controller.getCurrentController().getSelection();
    final MapController mapController = Controller.getCurrentModeController().getMapController();
    final NodeModel selected = selection.getSelected();
        final NodeModel rootNode = selected.getMap().getRootNode();
    boolean nodeFound = condition.checkNode(rootNode);
    if(nodeFound){
      selection.selectAsTheOnlyOneSelected(rootNode);
    }
    NodeModel next = rootNode;
    for(;;){
      next = filterController.findNext(next, rootNode, Direction.FORWARD, condition);
      if(next == null){
        break;
      }
      mapController.displayNode(next);
      if(nodeFound){
        selection.toggleSelected(next);
      }
      else{
        selection.selectAsTheOnlyOneSelected(next);
        nodeFound = true;
      }
    }
    if(condition.checkNode(selected))
        selection.makeTheSelected(selected);
  }
View Full Code Here

      return;
    builder.removeChildElements(MENU_USER_DEFINED_FILTERS);
    final DefaultComboBoxModel filterConditions = filterController.getFilterConditions();
    final HashSet<String> usedNames = new HashSet<String>();
    for(int i = 0; i < filterConditions.getSize(); i++){
      final ASelectableCondition condition = (ASelectableCondition) filterConditions.getElementAt(i);
      final String conditionName = condition.getUserName();
      if(conditionName != null && usedNames.add(conditionName)){
        final ApplyNamedFilterAction action = new ApplyNamedFilterAction(filterController, condition);
        builder.addAction(MENU_USER_DEFINED_FILTERS, action,UIBuilder.AS_CHILD );
      }
    }
View Full Code Here

TOP

Related Classes of org.freeplane.features.filter.condition.ASelectableCondition

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.