Package javax.swing.undo

Examples of javax.swing.undo.AbstractUndoableEdit


                        if (entry.getField(BibtexFields.KEY_FIELD) != null) {
                            for (Iterator<GroupTreeNode> i2 = groups.iterator(); i2.hasNext();) {
                                GroupTreeNode node = i2.next();
                                if (node.getGroup().supportsAdd()) {
                                    // Add the entry:
                                    AbstractUndoableEdit undo = node.getGroup().add(
                                        new BibtexEntry[] { entry });
                                    if (undo instanceof UndoableChangeAssignment)
                                        ((UndoableChangeAssignment) undo).setEditedNode(node);
                                    ce.addEdit(undo);
View Full Code Here


                m_panel.getSelectedEntries(),
                m_panel.getDatabase(),
                m_panel.frame()))
            return; // user aborted operation
       
        AbstractUndoableEdit undo = m_node.removeFromGroup(m_panel.getSelectedEntries());
        if (undo == null)
            return; // no changed made
       
        m_panel.undoManager.addEdit(undo);
        m_panel.markBaseChanged();
View Full Code Here

                GroupTreeNode node = removeGroupsNodes.elementAt(i);
                if (node.getGroup().containsAny(entries))
                    undoAll.addEdit(node.removeFromGroup(entries));
            }
            // then add
            AbstractUndoableEdit undoAdd = m_node.addToGroup(entries);
            if (undoAdd != null)
                undoAll.addEdit(undoAdd);
        } else {
            AbstractUndoableEdit undoAdd = m_node.addToGroup(entries);
            if (undoAdd == null)
                return; // no changed made
            undoAll.addEdit(undoAdd);
        }
       
View Full Code Here

  /** Removes the selected entries from this node's group. */
  public AbstractUndoableEdit removeFromGroup(BibtexEntry[] entries) {
    if (getGroup() == null)
      return null; // paranoia
    AbstractUndoableEdit undo = getGroup().remove(entries);
    if (undo instanceof UndoableChangeAssignment)
      ((UndoableChangeAssignment) undo).setEditedNode(this);
    return undo;
  }
View Full Code Here

        // if an editor is showing, its fields must be updated
        // after the assignment, and before that, the current
        // edit has to be stored:
        groupSelector.getActiveBasePanel().storeCurrentEdit();

        AbstractUndoableEdit undo = group.add(selection.getSelection());
        if (undo instanceof UndoableChangeAssignment)
          ((UndoableChangeAssignment) undo).setEditedNode(target);
        dtde.getDropTargetContext().dropComplete(true);
        groupSelector.revalidateGroups();
        groupSelector.concludeAssignment(undo, target, assignedEntries);
View Full Code Here

            if (groupsTree.getSelectionCount() != 1) {
                frame.output(Globals.lang("Please select exactly one group to move."));
                return false; // not possible
            }
        }
        AbstractUndoableEdit undo = null;
        if (!node.canMoveUp() || (undo = node.moveUp(GroupSelector.this)) == null) {
            frame.output(Globals.lang(
                    "Cannot move group \"%0\" up.", node.getGroup().getName()));
            return false; // not possible
        }
View Full Code Here

            if (groupsTree.getSelectionCount() != 1) {
                frame.output(Globals.lang("Please select exactly one group to move."));
                return false; // not possible
            }
        }
        AbstractUndoableEdit undo = null;
        if (!node.canMoveDown() || (undo = node.moveDown(GroupSelector.this)) == null) {
            frame.output(Globals.lang(
                    "Cannot move group \"%0\" down.", node.getGroup().getName()));
            return false; // not possible
        }
View Full Code Here

            if (groupsTree.getSelectionCount() != 1) {
                frame.output(Globals.lang("Please select exactly one group to move."));
                return false; // not possible
            }
        }
        AbstractUndoableEdit undo = null;
        if (!node.canMoveLeft() || (undo = node.moveLeft(GroupSelector.this)) == null) {
            frame.output(Globals.lang(
                    "Cannot move group \"%0\" left.", node.getGroup().getName()));
            return false; // not possible
        }
View Full Code Here

            if (groupsTree.getSelectionCount() != 1) {
                frame.output(Globals.lang("Please select exactly one group to move."));
                return false; // not possible
            }
        }
        AbstractUndoableEdit undo = null;
        if (!node.canMoveRight() || (undo = node.moveRight(GroupSelector.this)) == null) {
            frame.output(Globals.lang(
                    "Cannot move group \"%0\" right.", node.getGroup().getName()));
            return false; // not possible
        }
View Full Code Here

            final AbstractGroup oldGroup = node.getGroup();
            final GroupDialog gd = new GroupDialog(frame, panel, oldGroup);
            gd.setVisible(true);
            if (gd.okPressed()) {
                AbstractGroup newGroup = gd.getResultingGroup();
                AbstractUndoableEdit undoAddPreviousEntries
                    = gd.getUndoForAddPreviousEntries();
                UndoableModifyGroup undo = new UndoableModifyGroup(
                        GroupSelector.this, groupsRoot, node, newGroup);
                node.setGroup(newGroup);
                revalidateGroups(node);
View Full Code Here

TOP

Related Classes of javax.swing.undo.AbstractUndoableEdit

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.