1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2011 Association for Decentralized Information Management
\r
3 * in Industry THTH ry.
\r
4 * All rights reserved. This program and the accompanying materials
\r
5 * are made available under the terms of the Eclipse Public License v1.0
\r
6 * which accompanies this distribution, and is available at
\r
7 * http://www.eclipse.org/legal/epl-v10.html
\r
10 * VTT Technical Research Centre of Finland - initial API and implementation
\r
11 *******************************************************************************/
\r
12 package org.simantics.event;
\r
14 import org.eclipse.jface.resource.ImageDescriptor;
\r
15 import org.eclipse.ui.plugin.AbstractUIPlugin;
\r
16 import org.osgi.framework.Bundle;
\r
17 import org.osgi.framework.BundleContext;
\r
18 import org.simantics.utils.ui.gfx.AlphaAdjustmentImageDescriptor;
\r
19 import org.simantics.utils.ui.gfx.HSVAdjustmentImageDescriptor;
\r
22 * @author Tuukka Lehtonen
\r
24 public class Activator extends AbstractUIPlugin {
\r
26 public static final String BUNDLE_ID = "org.simantics.event";
\r
28 private static BundleContext context;
\r
30 public static ImageDescriptor HIDE_ICON;
\r
31 public static ImageDescriptor UNHIDE_ICON;
\r
32 public static ImageDescriptor MILESTONE_ICON;
\r
33 public static ImageDescriptor DIAMOND_ICON, DIAMOND2_ICON;
\r
34 public static ImageDescriptor MARK_MILESTONE_ICON;
\r
35 public static ImageDescriptor UNMARK_MILESTONE_ICON;
\r
36 public static ImageDescriptor SET_BASELINE_ICON;
\r
37 public static ImageDescriptor REMOVE_BASELINE_ICON;
\r
38 public static ImageDescriptor CLIPBOARD_ICON;
\r
40 static BundleContext getContext() {
\r
45 public void start(BundleContext bundleContext) throws Exception {
\r
46 Activator.context = bundleContext;
\r
48 Bundle bundle = bundleContext.getBundle();
\r
50 HIDE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png"));
\r
51 UNHIDE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png")), 0f, 0f, 1f), 96);
\r
52 MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png"));
\r
53 DIAMOND_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond.png"));
\r
54 DIAMOND2_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond2.png"));
\r
55 MARK_MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png"));
\r
56 UNMARK_MILESTONE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png")), 0f, 0f, 1f), 96);
\r
57 SET_BASELINE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png"));
\r
58 REMOVE_BASELINE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png")), 0f, 0f, 1f), 96);
\r
59 CLIPBOARD_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/clipboard.png"));
\r
63 public void stop(BundleContext bundleContext) throws Exception {
\r
64 Activator.context = null;
\r