Package org.freeplane.core.resources

Examples of org.freeplane.core.resources.NamedObject


    }
  }

  public static ComboBoxEditor getTextDateTimeEditor() {
      final ContainerComboBoxEditor editor = new ContainerComboBoxEditor();
    final NamedObject keyText = new NamedObject("text", "1Ab");
    final BasicComboBoxEditor textEditor = new FixedBasicComboBoxEditor(){
      private Object oldItem;

      @Override
          public void setItem(Object object) {
        oldItem = object;
        if(object instanceof FormattedDate)
          super.setItem("");
        else
          super.setItem(object);
          }

      @Override
          public Object getItem() {
              final Object item = super.getItem();
        final Object oldItem = this.oldItem;
        this.oldItem = null;
              if(item != null && oldItem != null && item.toString().equals(oldItem.toString()))
                return oldItem;
              if(ResourceController.getResourceController().getBooleanProperty("parse_data")
                  && item instanceof String){
                  final Object scannedObject = ScannerController.getController().parse((String)item);
                  return scannedObject;
              }
        return item;
          }

    };
    editor.put(keyText, textEditor);

    final NamedObject keyDate = new NamedObject("date", "");
    keyDate.setIcon(dateIcon);
    final TimeComboBoxEditor dateComboBoxEditor = new TimeComboBoxEditor(false){
      @Override
          public void setItem(Object object) {
        if(object instanceof FormattedDate && !((FormattedDate)object).containsTime())
          super.setItem(object);
        else
          super.setItem(null);
          }
    };

    dateComboBoxEditor.setItem();
    editor.put(keyDate, dateComboBoxEditor);

    final NamedObject keyDateTime = new NamedObject("date_time", "");
    keyDateTime.setIcon(dateTimeIcon);
    final TimeComboBoxEditor dateTimeComboBoxEditor = new TimeComboBoxEditor(true){
      @Override
          public void setItem(Object object) {
        if(object instanceof FormattedDate && ((FormattedDate)object).containsTime())
          super.setItem(object);
View Full Code Here


    return inputString;
  }

  public static NamedObject createTranslatedString(final String key) {
    final String fs = TextUtils.getText(key);
    return new NamedObject(key, fs);
  }
View Full Code Here

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(TextController.FILTER_NODE)
    || namedObject.objectEquals(TextController.FILTER_PARENT)
    || namedObject.objectEquals(TextController.FILTER_DETAILS)
    || namedObject.objectEquals(TextController.FILTER_NOTE)
    || namedObject.objectEquals(TextController.FILTER_ANYTEXT);
  }
View Full Code Here

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

  public boolean canHandle(final Object selectedItem) {
    if (!(selectedItem instanceof NamedObject)) {
      return false;
    }
    final NamedObject namedObject = (NamedObject) selectedItem;
    return namedObject.objectEquals(ReminderConditionController.FILTER_REMINDER);
  }
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.