]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.structural.ui/src/org/simantics/structural/ui/menuContributions/LinkWithEditorContribution.java
Fixed all line endings of the repository
[simantics/platform.git] / bundles / org.simantics.structural.ui / src / org / simantics / structural / ui / menuContributions / LinkWithEditorContribution.java
1 /*******************************************************************************
2  * Copyright (c) 2007, 2011 Association for Decentralized Information Management in
3  * Industry THTH ry.
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
8  *
9  * Contributors:
10  *     VTT Technical Research Centre of Finland - initial API and implementatio
11  *******************************************************************************/
12 package org.simantics.structural.ui.menuContributions;
13
14 import org.eclipse.jface.action.ActionContributionItem;
15 import org.eclipse.jface.preference.IPreferenceStore;
16 import org.simantics.structural.ui.Activator;
17
18 /**
19  * @author Tuukka Lehtonen
20  */
21 public class LinkWithEditorContribution extends ActionContributionItem {
22
23     public LinkWithEditorContribution(String preferenceKey) {
24         this(preferenceKey, Activator.getDefault().getPreferenceStore());
25     }
26
27     public LinkWithEditorContribution(String preferenceKey, IPreferenceStore preferenceStore) {
28         super(new LinkWithEditorAction(preferenceKey, preferenceStore));
29     }
30
31     public static class LinkWithEditorAction extends PreferenceCheckBoxAction {
32         public LinkWithEditorAction(String preferenceKey, IPreferenceStore preferenceStore) {
33             super("Link With Editor", preferenceKey, preferenceStore);
34             setImageDescriptor(Activator.SYNCED_ICON);
35         }
36     }
37
38 }