kchong | 38cbf17 | 2006-03-29 03:38:21 +0000 | [diff] [blame] | 1 | /******************************************************************************* |
kchong | 44ac958 | 2008-04-21 18:19:48 +0000 | [diff] [blame] | 2 | * Copyright (c) 2001, 2008 IBM Corporation and others. |
kchong | 38cbf17 | 2006-03-29 03:38:21 +0000 | [diff] [blame] | 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 | *******************************************************************************/ |
kchong | 2be71b3 | 2006-04-11 16:32:03 +0000 | [diff] [blame] | 11 | package org.eclipse.wst.xsd.ui.internal.adt.design.editpolicies; |
kchong | 38cbf17 | 2006-03-29 03:38:21 +0000 | [diff] [blame] | 12 | |
| 13 | import org.eclipse.gef.editpolicies.SelectionEditPolicy; |
kchong | 2be71b3 | 2006-04-11 16:32:03 +0000 | [diff] [blame] | 14 | import org.eclipse.wst.xsd.ui.internal.adt.design.editparts.model.IFeedbackHandler; |
kchong | 38cbf17 | 2006-03-29 03:38:21 +0000 | [diff] [blame] | 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 | } |
kchong | 44ac958 | 2008-04-21 18:19:48 +0000 | [diff] [blame] | 39 | |
| 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 | } |
kchong | 38cbf17 | 2006-03-29 03:38:21 +0000 | [diff] [blame] | 51 | |
| 52 | } |