Package org.freeplane.core.resources

Examples of org.freeplane.core.resources.NamedObject


  }

  public ASelectableCondition createCondition(final Object selectedItem, final NamedObject simpleCond,
                                              final Object value, final boolean matchCase,
                                              final boolean matchApproximately) {
    final NamedObject namedObject = (NamedObject) selectedItem;
    if (namedObject.objectEquals(FILTER_LINK)) {
      if (simpleCond.objectEquals(ConditionFactory.FILTER_IS_EQUAL_TO)) {
        return new HyperLinkEqualsCondition((String) value, matchCase, matchApproximately);
      }
      if (simpleCond.objectEquals(ConditionFactory.FILTER_CONTAINS)) {
        return new HyperLinkContainsCondition((String) value, matchCase, matchApproximately);
      }
      if (simpleCond.objectEquals(ConditionFactory.FILTER_EXIST)) {
        return new HyperLinkExistsCondition();
      }
      return null;
    }
    if (namedObject.objectEquals(CONNECTOR_LABEL)) {
      if (simpleCond.objectEquals(ConditionFactory.FILTER_IS_EQUAL_TO)) {
        return new ConnectorLabelEqualsCondition((String) value, matchCase, matchApproximately);
      }
      if (simpleCond.objectEquals(ConditionFactory.FILTER_CONTAINS)) {
        return new ConnectorLabelContainsCondition((String) value, matchCase, matchApproximately);
      }
      return null;
    }
    if (namedObject.objectEquals(CONNECTOR)) {
      if (simpleCond.objectEquals(ConditionFactory.FILTER_EXIST)) {
        return new ConnectorExistsCondition();
      }
    }
    return null;
View Full Code Here


    }
    return null;
  }

  public ComboBoxModel getConditionsForProperty(final Object property) {
    final NamedObject no = (NamedObject) property;
    final Object[] linkConditionNames;
    if (no.getObject().equals(FILTER_LINK)) {
      linkConditionNames = new NamedObject[] {
              TextUtils.createTranslatedString(ConditionFactory.FILTER_IS_EQUAL_TO),
              TextUtils.createTranslatedString(ConditionFactory.FILTER_CONTAINS),
              TextUtils.createTranslatedString(ConditionFactory.FILTER_EXIST) };
    }
    else if (no.getObject().equals(CONNECTOR_LABEL)) {
      linkConditionNames = new NamedObject[] {
              TextUtils.createTranslatedString(ConditionFactory.FILTER_IS_EQUAL_TO),
              TextUtils.createTranslatedString(ConditionFactory.FILTER_CONTAINS) };
    }
    else {
View Full Code Here

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(PriorityConditionController.FILTER_PRIORITY);
  }
View Full Code Here

      if (styles.contains(styleString)) {
        setStyle(styleString);
        return;
      }
      // search for predefined styles by key
      final IStyle styleNamedObject = StyleFactory.create(new NamedObject(styleName));
      if (styles.contains(styleNamedObject)) {
        setStyle(styleNamedObject);
        return;
      }
      // search for predefined styles by their translated name (style.toString())
View Full Code Here

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(IconConditionController.FILTER_ICON);
  }
View Full Code Here

    final JComboBox box = new JComboBox();
    box.setEditable(false);
    final File dir = getLastCurrentDir() != null ? getLastCurrentDir() : chooser.getCurrentDirectory();
    final File templateDir = defaultStandardTemplateDir();
    final File userTemplateDir = defaultUserTemplateDir();
    box.addItem(new NamedObject(dir, TextUtils.getText("current_dir")));
    box.addItem(new NamedObject(templateDir, TextUtils.getText("template_dir")));
    box.addItem(new NamedObject(userTemplateDir, TextUtils.getText("user_template_dir")));
    box.addActionListener(new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        final JComboBox box = (JComboBox) e.getSource();
        final NamedObject obj = (NamedObject) box.getSelectedItem();
        final File dir = (File) obj.getObject();
        chooser.setCurrentDirectory(dir);
      }
    });
    File selectedDir = chooser.getCurrentDirectory();
    final String selectedPath = selectedDir.getAbsolutePath();
    if (!selectedDir.equals(dir)) {
      for (int i = 0; i < box.getItemCount(); i++) {
        NamedObject item = (NamedObject) box.getItemAt(i);
        File itemDir = (File) item.getObject();
        if (itemDir.getAbsolutePath().equals(selectedPath)) {
          box.setSelectedItem(item);
          break;
        }
      }
View Full Code Here

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(CloneConditionController.FILTER_CLONE);
  }
View Full Code Here

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(ScriptConditionController.FILTER_SCRIPT);
  }
View Full Code Here

    list.addElement(TextUtils.createTranslatedString(FILTER_SCRIPT));
    return list;
  }

  public Object[] getScriptConditionNames() {
    return new NamedObject[] { new NamedObject(ScriptCondition.NAME, " ")};
  }
View Full Code Here

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(TimeConditionController.FILTER_TIME);
  }
View Full Code Here

TOP

Related Classes of org.freeplane.core.resources.NamedObject

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.