X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.event%2Fsrc%2Forg%2Fsimantics%2Fevent%2FActivator.java;fp=bundles%2Forg.simantics.event%2Fsrc%2Forg%2Fsimantics%2Fevent%2FActivator.java;h=e8e6e2f1718bb7bc6881f30156ee8932ed4078aa;hb=969bd23cab98a79ca9101af33334000879fb60c5;hp=0000000000000000000000000000000000000000;hpb=866dba5cd5a3929bbeae85991796acb212338a08;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.event/src/org/simantics/event/Activator.java b/bundles/org.simantics.event/src/org/simantics/event/Activator.java new file mode 100644 index 000000000..e8e6e2f17 --- /dev/null +++ b/bundles/org.simantics.event/src/org/simantics/event/Activator.java @@ -0,0 +1,67 @@ +/******************************************************************************* + * Copyright (c) 2007, 2011 Association for Decentralized Information Management + * in Industry THTH ry. + * 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: + * VTT Technical Research Centre of Finland - initial API and implementation + *******************************************************************************/ +package org.simantics.event; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.Bundle; +import org.osgi.framework.BundleContext; +import org.simantics.utils.ui.gfx.AlphaAdjustmentImageDescriptor; +import org.simantics.utils.ui.gfx.HSVAdjustmentImageDescriptor; + +/** + * @author Tuukka Lehtonen + */ +public class Activator extends AbstractUIPlugin { + + public static final String BUNDLE_ID = "org.simantics.event"; + + private static BundleContext context; + + public static ImageDescriptor HIDE_ICON; + public static ImageDescriptor UNHIDE_ICON; + public static ImageDescriptor MILESTONE_ICON; + public static ImageDescriptor DIAMOND_ICON, DIAMOND2_ICON; + public static ImageDescriptor MARK_MILESTONE_ICON; + public static ImageDescriptor UNMARK_MILESTONE_ICON; + public static ImageDescriptor SET_BASELINE_ICON; + public static ImageDescriptor REMOVE_BASELINE_ICON; + public static ImageDescriptor CLIPBOARD_ICON; + + static BundleContext getContext() { + return context; + } + + @Override + public void start(BundleContext bundleContext) throws Exception { + Activator.context = bundleContext; + + Bundle bundle = bundleContext.getBundle(); + + HIDE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png")); + UNHIDE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/hide.png")), 0f, 0f, 1f), 96); + MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png")); + DIAMOND_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond.png")); + DIAMOND2_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/diamond2.png")); + MARK_MILESTONE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png")); + UNMARK_MILESTONE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/milestone.png")), 0f, 0f, 1f), 96); + SET_BASELINE_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png")); + REMOVE_BASELINE_ICON = AlphaAdjustmentImageDescriptor.adjustAlpha(HSVAdjustmentImageDescriptor.adjust(ImageDescriptor.createFromURL(bundle.getResource("icons/baseline.png")), 0f, 0f, 1f), 96); + CLIPBOARD_ICON = ImageDescriptor.createFromURL(bundle.getResource("icons/clipboard.png")); + } + + @Override + public void stop(BundleContext bundleContext) throws Exception { + Activator.context = null; + } + +}