Package org.freeplane.features.attribute

Examples of org.freeplane.features.attribute.Attribute


  public void actionPerformed(final ActionEvent e) {
    final ModeController modeController = Controller.getCurrentModeController();
    final NodeModel node = modeController.getMapController().getSelectedNode();
    final ArrayList<AttributeHolder> scripts = new ArrayList<AttributeHolder>();
    for (int position = 0; position < NodeAttributeTableModel.getModel(node).getAttributeTableLength(); position++) {
      final Attribute attribute = NodeAttributeTableModel.getModel(node).getAttribute(position);
      if (attribute.getName().startsWith(ScriptingEngine.SCRIPT_PREFIX)) {
        scripts.add(new AttributeHolder(new Attribute(attribute), position));
      }
    }
    final NodeScriptModel nodeScriptModel = new NodeScriptModel(scripts, node);
    final ScriptEditorPanel scriptEditorPanel = new ScriptEditorPanel(nodeScriptModel, true);
    scriptEditorPanel.setVisible(true);
View Full Code Here


            scriptNameSuffix++;
            break;
          }
        }
      } while (found);
      mScripts.add(new AttributeHolder(new Attribute(scriptName + scriptNameSuffix, ""), attributeIndex));
      isDirty = true;
      return index;
    }
View Full Code Here

    public void endDialog(final boolean pIsCanceled) {
      if (!pIsCanceled) {
        final int attributeTableLength = NodeAttributeTableModel.getModel(mNode).getAttributeTableLength();
        for (final AttributeHolder holder : mScripts) {
          final Attribute attribute = holder.mAttribute;
          final int position = holder.mPosition;
          final MAttributeController attributeController = (MAttributeController) AttributeController
              .getController();
          if (attributeTableLength <= position) {
            attributeController.addAttribute(mNode, attribute);
          }
          else if (NodeAttributeTableModel.getModel(mNode).getAttribute(position).getValue() != attribute
              .getValue()) {
            attributeController.setAttribute(mNode, position, attribute);
          }
        }
      }
View Full Code Here

    public int getAmountOfScripts() {
      return mScripts.size();
    }

    public ScriptHolder getScript(final int pIndex) {
      final Attribute attribute = ((AttributeHolder) mScripts.get(pIndex)).mAttribute;
      return new ScriptHolder(attribute.getName(), attribute.getValue().toString());
    }
View Full Code Here

    @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

      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

    }
    final MAttributeController controller = MAttributeController.getController();
    for(int i = 0; i < attributes.length;){
      final String name = attributes[i++].toString();
      final Object value = attributes[i++];
      controller.addAttribute(node, new Attribute(name, value));
    }
  }
View Full Code Here

    if(attributes == null){
      return false;
    }
    final int rowCount = attributes.getRowCount();
    for(int i = 0; i < rowCount; i++){
      final Attribute attribute = attributes.getAttribute(i);
      final Object value = attribute.getValue();
      if (value instanceof URI && checkLink((URI)value))
        return true;
    }
    return false;
  }
View Full Code Here

  }

  /**
   */
  public void moveRowDown(final int row) {
    final Attribute attribute = getAttributeController().performRemoveRow(getNodeAttributeModel(), row);
    getAttributeController().performInsertRow(getNodeAttributeModel(), (row + 1), attribute.getName(),
        attribute.getValue());
  }
View Full Code Here

  }

  /**
   */
  public void moveRowUp(final int row) {
    final Attribute attribute = getAttributeController().performRemoveRow(getNodeAttributeModel(), row);
    getAttributeController().performInsertRow(getNodeAttributeModel(), (row - 1), attribute.getName(),
        attribute.getValue());
  }
View Full Code Here

TOP

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

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.