kchong | 38cbf17 | 2006-03-29 03:38:21 +0000 | [diff] [blame^] | 1 | /******************************************************************************* |
| 2 | * Copyright (c) 2001, 2006 IBM Corporation and others. |
| 3 | * All rights reserved. This program and the accompanying materials |
| 4 | * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | * which accompanies this distribution, and is available at |
| 6 | * http://www.eclipse.org/legal/epl-v10.html |
| 7 | * |
| 8 | * Contributors: |
| 9 | * IBM Corporation - initial API and implementation |
| 10 | *******************************************************************************/ |
| 11 | package org.eclipse.wst.xsd.adt.design.editpolicies; |
| 12 | |
| 13 | import org.eclipse.gef.editpolicies.SelectionEditPolicy; |
| 14 | import org.eclipse.wst.xsd.adt.design.editparts.model.IFeedbackHandler; |
| 15 | |
| 16 | public class ADTSelectionFeedbackEditPolicy extends SelectionEditPolicy |
| 17 | { |
| 18 | |
| 19 | public ADTSelectionFeedbackEditPolicy() |
| 20 | { |
| 21 | super(); |
| 22 | } |
| 23 | |
| 24 | protected void hideSelection() |
| 25 | { |
| 26 | if (getHost() instanceof IFeedbackHandler) |
| 27 | { |
| 28 | ((IFeedbackHandler) getHost()).removeFeedback(); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | protected void showSelection() |
| 33 | { |
| 34 | if (getHost() instanceof IFeedbackHandler) |
| 35 | { |
| 36 | ((IFeedbackHandler) getHost()).addFeedback(); |
| 37 | } |
| 38 | } |
| 39 | |
| 40 | } |