ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Campbell" <ccampb...@novell.com>
Subject [Antidote] Cut/Copy/Paste
Date Wed, 04 Dec 2002 17:26:01 GMT
All,

While we are in the middle of adding things to the edit menu, I would like to suggest something
that I have found extermely helpful.

I have created cut/copy/paste commands that work on the Navigation tree.
The modules consist of:

-CopyElementCmd, CutElementCmd, PasteElementCmd, with corresponding Events.
-Clipboard that takes ACSElements in a copyToClipboard(ACSElement element) method.

I modified the AppContext to hold an instance of the Clipboard which makes it accessible to
any command.

Here is the code from CopyElementCmd

  public void run() {
        ACSElement[] elements =
                getContext().getSelectionManager().getSelectedElements();

        ACSElement element =
                (ACSElement)elements[elements.length - 1].cloneNode(true);

        getContext().getACSElementClipboard().copyToClipboard(element);

        getContext().getEventBus().postEvent(
            new CopyElementEvent(getContext()));
    }


And like David's undo/redo there are modification in the antidote.properties and action.properties.

If this is something we want to implement, it is independent of the other projects we are
working on.

Craig


--
To unsubscribe, e-mail:   <mailto:ant-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-dev-help@jakarta.apache.org>


Mime
View raw message