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