All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nu.zoom.ldap.eon.clipboard.impl.DirectoryObjectCutClipboardItem Maven / Gradle / Ivy

The newest version!
/*
 * Copyright (C) 2005 Johan Maasing johan at zoom.nu Licensed under the Apache
 * License, Version 2.0 (the "License"); you may not use this file except in
 * compliance with the License. You may obtain a copy of the License at
 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law
 * or agreed to in writing, software distributed under the License is
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the specific language
 * governing permissions and limitations under the License.
 */
package nu.zoom.ldap.eon.clipboard.impl;

import nu.zoom.ldap.eon.clipboard.DirectoryClipboardItem;
import nu.zoom.ldap.eon.directory.event.DirectoryEventListenerRegistry;
import nu.zoom.ldap.eon.directory.tree.DirectoryTreeObject;
import nu.zoom.swing.desktop.Workbench;
import nu.zoom.swing.desktop.common.BackendException;
import nu.zoom.util.UniqueIDGenerator;

import org.ops4j.gaderian.Messages;

/**
 * @author $Author: johan $
 * @version $Revision: 1.4 $
 */
public class DirectoryObjectCutClipboardItem implements DirectoryClipboardItem,
		ClipboardAction
{

	private static UniqueIDGenerator idGenerator = new UniqueIDGenerator();

	private String id;
	private String description;
	private Messages messages;
	private Workbench workbench;
	private DirectoryTreeObject sourceObject;
	private DirectoryEventListenerRegistry eventRegistry;

	public DirectoryObjectCutClipboardItem(DirectoryTreeObject sourceObject,
			Messages messages, Workbench workbench,
			DirectoryEventListenerRegistry eventRegistry) {
		super();
		this.messages = messages;
		this.workbench = workbench;
		this.sourceObject = sourceObject;
		this.eventRegistry = eventRegistry;
		id = idGenerator.getID();
		description = messages.format("clipboard.object.copy", sourceObject
				.getConnectionInformation().getDescription(), sourceObject
				.getDistinguishedName().toString());

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see nu.zoom.ldap.eon.clipboard.DirectoryClipboardItem#getID()
	 */
	public String getID() {
		return id;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see nu.zoom.ldap.eon.clipboard.DirectoryClipboardItem#getDescription()
	 */
	public String getDescription() {
		return description;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see nu.zoom.ldap.eon.clipboard.impl.ClipboardAction#execute(javax.naming.ldap.InitialLdapContext,
	 *      javax.naming.Name)
	 */
	public void execute(DirectoryTreeObject target) throws BackendException {
		// TODO Implement
		System.out.println(description + ":" + " To "
				+ target.getDistinguishedName().toString());
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy