diff options
Diffstat (limited to 'org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeDecorator.java')
-rw-r--r-- | org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeDecorator.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeDecorator.java b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeDecorator.java new file mode 100644 index 000000000..e39b2dc2f --- /dev/null +++ b/org.eclipse.debug.ui/ui/org/eclipse/debug/ui/PrototypeDecorator.java @@ -0,0 +1,52 @@ +/******************************************************************************* + * Copyright (c) 2017 Obeo. + * All rights reserved. This program and the accompanying materials + * are made available under the terms of the Eclipse Public License v1.0 + * which accompanies this distribution, and is available at + * http://www.eclipse.org/legal/epl-v10.html + * + * Contributors: + * Obeo - initial API and implementation + *******************************************************************************/ +package org.eclipse.debug.ui; + +import org.eclipse.debug.core.ILaunchConfiguration; +import org.eclipse.debug.internal.core.LaunchConfiguration; +import org.eclipse.jface.viewers.IDecoration; +import org.eclipse.jface.viewers.ILabelProviderListener; +import org.eclipse.jface.viewers.ILightweightLabelDecorator; + +/** + * Decorator for {@link ILaunchConfiguration} prototypes. + * + * @since 3.13 + * + */ +public class PrototypeDecorator implements ILightweightLabelDecorator { + + @Override + public void addListener(ILabelProviderListener listener) { + } + + @Override + public void dispose() { + } + + @Override + public boolean isLabelProperty(Object element, String property) { + return false; + } + + @Override + public void removeListener(ILabelProviderListener listener) { + } + + @Override + public void decorate(Object element, IDecoration decoration) { + if (element instanceof LaunchConfiguration) { + if (((LaunchConfiguration) element).isPrototype()) { + decoration.addOverlay(DebugUITools.getImageDescriptor(IDebugUIConstants.IMG_OVR_PROTOTYPE)); + } + } + } +} |