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