blob: 0747165e757e4c81d921dc3d87984f9873e074d4 [file] [log] [blame]
kchong38cbf172006-03-29 03:38:21 +00001/*******************************************************************************
kchong44ac9582008-04-21 18:19:48 +00002 * Copyright (c) 2001, 2008 IBM Corporation and others.
kchong38cbf172006-03-29 03:38:21 +00003 * 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 *******************************************************************************/
kchong2be71b32006-04-11 16:32:03 +000011package org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies;
kchong38cbf172006-03-29 03:38:21 +000012
13import org.eclipse.gef.editpolicies.SelectionEditPolicy;
kchong2be71b32006-04-11 16:32:03 +000014import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler;
kchong38cbf172006-03-29 03:38:21 +000015
16public 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 }
kchong44ac9582008-04-21 18:19:48 +000039
40 protected void showFocus()
41 {
42 super.showFocus();
43 getHost().setFocus(true);
44 }
45
46 protected void hideFocus()
47 {
48 super.hideFocus();
49 getHost().setFocus(false);
50 }
kchong38cbf172006-03-29 03:38:21 +000051
52}