Package org.freeplane.features.attribute

Examples of org.freeplane.features.attribute.NodeAttributeTableModel


    }
  }

  @Override
  public void performRegistrySubtreeAttributes(final NodeModel node) {
    final NodeAttributeTableModel nodeAttributeTableModel = NodeAttributeTableModel.getModel(node);
    for (int i = 0; i < nodeAttributeTableModel.getRowCount(); i++) {
      final String name = nodeAttributeTableModel.getValueAt(i, 0).toString();
      final String value = nodeAttributeTableModel.getValueAt(i, 1).toString();
      performRegistryAttributeValue(name, value, false);
    }
    for (final NodeModel child : Controller.getCurrentModeController().getMapController().childrenUnfolded(node)) {
      performRegistrySubtreeAttributes(child);
    }
View Full Code Here


    performRemoveRow(NodeAttributeTableModel.getModel(pNode), pPosition);
  }

  public void setAttribute(final NodeModel pNode, final int pPosition, final Attribute pAttribute) {
    createAttributeTableModel(pNode);
    final NodeAttributeTableModel model = NodeAttributeTableModel.getModel(pNode);
    performSetValueAt(model, pAttribute.getName(), pPosition, 0);
    performSetValueAt(model, pAttribute.getValue(), pPosition, 1);
  }
View Full Code Here

  }

    public void copyAttributesToNode(NodeModel source, NodeModel target) {
        if (source == null)
            return;
        final NodeAttributeTableModel model = NodeAttributeTableModel.getModel(source);
        if (model.getRowCount() == 0)
            return;
        final int attributeTableLength = model.getAttributeTableLength();
        for(int i = 0; i < attributeTableLength; i++){
            final Attribute attribute = model.getAttribute(i);
            addAttribute(target, new Attribute(attribute.getName(), attribute.getValue()));
        }
    }
View Full Code Here

      super.actionPerformed(e);
    }

    @Override
    protected void performAction(final NodeModel model) {
      final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(model);
      for (int i = attributes.getRowCount() - 1; i >= 0; i--) {
        final Attribute attribute = attributes.getAttribute(i);
        if (attribute.getName().equals(name) && attribute.getValue().equals(value)) {
          attributeController.performRemoveRow(attributes, i);
          attributeController.performInsertRow(attributes, i, replacingName, replacingValue);
        }
      }
View Full Code Here

    }
    performScriptOperation(node);
  }

  static void performScriptOperation(final NodeModel node) {
    final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(node);
    if (attributes == null) {
      return;
    }
    for (int row = 0; row < attributes.getRowCount(); ++row) {
      final String attrKey = (String) attributes.getName(row);
      final Object value = attributes.getValue(row);
      if(value instanceof String){
        final String script = (String) value;
        if (attrKey.startsWith(ScriptingEngine.SCRIPT_PREFIX)) {
          executeScript(node, script);
        }
View Full Code Here

    }

    @Override
    protected void performAction(final NodeModel model) {
      attributeController.createAttributeTableModel(model);
      final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(model);
      attributeController.performInsertRow(attributes, attributes.getRowCount(), name, value);
    }
View Full Code Here

      super.actionPerformed(e);
    }

    @Override
    protected void performAction(final NodeModel model) {
      final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(model);
      for (int i = attributes.getRowCount() - 1; i >= 0; i--) {
        if (attributes.getAttribute(i).getName().equals(name)) {
          attributeController.performRemoveRow(attributes, i);
        }
      }
    }
View Full Code Here

      super.actionPerformed(e);
    }

    @Override
    protected void performAction(final NodeModel model) {
      final NodeAttributeTableModel attributes = NodeAttributeTableModel.getModel(model);
      for (int i = attributes.getRowCount() - 1; i >= 0; i--) {
        final Attribute attribute = attributes.getAttribute(i);
        if (attribute.getName().equals(name) && attribute.getValue().equals(value)) {
          attributeController.performRemoveRow(attributes, i);
        }
      }
    }
View Full Code Here

  }

  /**
   */
  private void copyAttributes(final NodeModel node) {
    final NodeAttributeTableModel model = NodeAttributeTableModel.getModel(node);
    if(model == null){
      attributes = null;
      return;
    }
    final int attributeTableLength = model.getAttributeTableLength();
    attributes = new Object[attributeTableLength * 2];
    for(int i = 0; i < attributeTableLength; i++){
      final Attribute attribute = model.getAttribute(i);
      attributes[2 * i] = attribute.getName();
      attributes[2 * i+1] = attribute.getValue();
    }
  }
View Full Code Here

  }
  @Override
    public void setEnabled() {
    final NodeModel node = Controller.getCurrentModeController().getMapController().getSelectedNode();
    if(node != null){
      final NodeAttributeTableModel model = NodeAttributeTableModel.getModel(node);
      setEnabled(model != null && model.getAttributeTableLength() > 0);
    }
    else
      setEnabled(false);
    }
View Full Code Here

TOP

Related Classes of org.freeplane.features.attribute.NodeAttributeTableModel

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.