X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.document.ui%2Fsrc%2Forg%2Fsimantics%2Fdocument%2Fui%2FDocumentView.java;h=0d7973f6af728ddf0fa02096e6d08a91ecd8fd03;hb=e34fedee69a6f7e3ef2188a70d8be60f7d179c10;hp=025b88b0808348357691bbb9c0f169f3eb65c7f6;hpb=25b6c25959c1fb3c60bb41cd0e1f0808e7fc3769;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.document.ui/src/org/simantics/document/ui/DocumentView.java b/bundles/org.simantics.document.ui/src/org/simantics/document/ui/DocumentView.java index 025b88b08..0d7973f6a 100644 --- a/bundles/org.simantics.document.ui/src/org/simantics/document/ui/DocumentView.java +++ b/bundles/org.simantics.document.ui/src/org/simantics/document/ui/DocumentView.java @@ -1,67 +1,67 @@ -/******************************************************************************* - * Copyright (c) 2007, 2012 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.document.ui; - -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.IAction; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.ui.IWorkbenchPart; -import org.simantics.ui.workbench.IPropertyPage; -import org.simantics.utils.ui.BundleUtils; -import org.simantics.views.swt.ModelledView; - -/** - * @author Antti Villberg - */ -public class DocumentView extends ModelledView { - - private boolean pinSelection = false; - - @Override - protected String configurationURI() { - return DocumentUIResource.URIs.View; - } - - @Override - protected IPropertyPage getPropertyPage() { - return null; - } - - @Override - protected void inputChanged(IWorkbenchPart provider, Object input) { - if (pinSelection) - return; - super.inputChanged(provider, input); - } - - @Override - public void createPartControl(Composite parent) { - super.createPartControl(parent); - getViewSite().getActionBars().getToolBarManager().add(new PinSelection()); - } - - private class PinSelection extends Action { - public PinSelection() { - super("Pin Selection", IAction.AS_CHECK_BOX); - setImageDescriptor( - BundleUtils.getImageDescriptorFromPlugin( - "org.eclipse.ui", - "icons/full/etool16/pin_editor.png")); - } - - @Override - public void run() { - pinSelection = isChecked(); - } - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2012 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.document.ui; + +import org.eclipse.jface.action.Action; +import org.eclipse.jface.action.IAction; +import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.IWorkbenchPart; +import org.simantics.ui.workbench.IPropertyPage; +import org.simantics.utils.ui.BundleUtils; +import org.simantics.views.swt.ModelledView; + +/** + * @author Antti Villberg + */ +public class DocumentView extends ModelledView { + + private boolean pinSelection = false; + + @Override + protected String configurationURI() { + return DocumentUIResource.URIs.View; + } + + @Override + protected IPropertyPage getPropertyPage() { + return null; + } + + @Override + protected void inputChanged(IWorkbenchPart provider, Object input) { + if (pinSelection) + return; + super.inputChanged(provider, input); + } + + @Override + public void createPartControl(Composite parent) { + super.createPartControl(parent); + getViewSite().getActionBars().getToolBarManager().add(new PinSelection()); + } + + private class PinSelection extends Action { + public PinSelection() { + super("Pin Selection", IAction.AS_CHECK_BOX); + setImageDescriptor( + BundleUtils.getImageDescriptorFromPlugin( + "org.eclipse.ui", + "icons/full/etool16/pin_editor.png")); + } + + @Override + public void run() { + pinSelection = isChecked(); + } + } + +}