Java tutorial
/* Copyright (C) 2006 NTT DATA Corporation This program is free software; you can redistribute it and/or Modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. */ package com.clustercontrol.composite.action; import org.eclipse.jface.action.Action; import org.eclipse.jface.viewers.StructuredSelection; import com.clustercontrol.bean.Property; import com.clustercontrol.bean.PropertyDefineConstant; import com.clustercontrol.util.Messages; import com.clustercontrol.viewer.PropertySheet; /** * ??<BR> * * @version 1.0.0 * @since 1.0.0 */ public class DeletePropertyAction extends Action { PropertySheet m_viewer; /** * * * @param viewer */ public DeletePropertyAction(PropertySheet viewer) { super(); setText(Messages.getString("delete")); //PropertySheet?? m_viewer = viewer; } /* * (non-Javadoc) * * @see org.eclipse.jface.action.IAction#run() */ @Override public void run() { //???? StructuredSelection selection = (StructuredSelection) m_viewer.getSelection(); Property property = (Property) selection.getFirstElement(); if (property.getCopy() == PropertyDefineConstant.COPY_OK) { //??? property.getParent().removeChildren(property); } //PropertySheet m_viewer.refresh(); } }