1 /*******************************************************************************
\r
2 * Copyright (c) 2007, 2012 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.document.ui;
\r
14 import org.eclipse.jface.action.Action;
\r
15 import org.eclipse.jface.action.IAction;
\r
16 import org.eclipse.swt.widgets.Composite;
\r
17 import org.eclipse.ui.IWorkbenchPart;
\r
18 import org.simantics.ui.workbench.IPropertyPage;
\r
19 import org.simantics.utils.ui.BundleUtils;
\r
20 import org.simantics.views.swt.ModelledView;
\r
23 * @author Antti Villberg
\r
25 public class DocumentView extends ModelledView {
\r
27 private boolean pinSelection = false;
\r
30 protected String configurationURI() {
\r
31 return DocumentUIResource.URIs.View;
\r
35 protected IPropertyPage getPropertyPage() {
\r
40 protected void inputChanged(IWorkbenchPart provider, Object input) {
\r
43 super.inputChanged(provider, input);
\r
47 public void createPartControl(Composite parent) {
\r
48 super.createPartControl(parent);
\r
49 getViewSite().getActionBars().getToolBarManager().add(new PinSelection());
\r
52 private class PinSelection extends Action {
\r
53 public PinSelection() {
\r
54 super("Pin Selection", IAction.AS_CHECK_BOX);
\r
56 BundleUtils.getImageDescriptorFromPlugin(
\r
58 "icons/full/etool16/pin_editor.png"));
\r
63 pinSelection = isChecked();
\r