X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.diagram%2Fsrc%2Forg%2Fsimantics%2Fdiagram%2Fhandler%2FCollapseAll.java;h=256a0b0582cccf7f7f9fbc39cbaf2401843b198e;hp=2a317b3a607be7d8d593fb5d1f4c7211d0abc92f;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.diagram/src/org/simantics/diagram/handler/CollapseAll.java b/bundles/org.simantics.diagram/src/org/simantics/diagram/handler/CollapseAll.java index 2a317b3a6..256a0b058 100644 --- a/bundles/org.simantics.diagram/src/org/simantics/diagram/handler/CollapseAll.java +++ b/bundles/org.simantics.diagram/src/org/simantics/diagram/handler/CollapseAll.java @@ -1,45 +1,45 @@ -/******************************************************************************* - * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. - * 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.diagram.handler; - - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.IHandler; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.part.IPage; -import org.simantics.diagram.symbollibrary.ui.SymbolLibraryPage; -import org.simantics.diagram.symbollibrary.ui.SymbolPageView; - -public class CollapseAll extends AbstractHandler implements IHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - - IWorkbenchPart part = HandlerUtil.getActivePart(event); - if(part == null) return null; - if(part instanceof SymbolPageView) { - SymbolPageView view = (SymbolPageView)part; - IPage page = view.getCurrentPage(); - if(page == null) return null; - if(page instanceof SymbolLibraryPage) { - SymbolLibraryPage libraryPage = (SymbolLibraryPage)page; - libraryPage.setAllExpandedStates(false); - } - } - - return null; - - } - -} +/******************************************************************************* + * Copyright (c) 2007 VTT Technical Research Centre of Finland and others. + * 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.diagram.handler; + + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.core.commands.IHandler; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.handlers.HandlerUtil; +import org.eclipse.ui.part.IPage; +import org.simantics.diagram.symbollibrary.ui.SymbolLibraryPage; +import org.simantics.diagram.symbollibrary.ui.SymbolPageView; + +public class CollapseAll extends AbstractHandler implements IHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + + IWorkbenchPart part = HandlerUtil.getActivePart(event); + if(part == null) return null; + if(part instanceof SymbolPageView) { + SymbolPageView view = (SymbolPageView)part; + IPage page = view.getCurrentPage(); + if(page == null) return null; + if(page instanceof SymbolLibraryPage) { + SymbolLibraryPage libraryPage = (SymbolLibraryPage)page; + libraryPage.setAllExpandedStates(false); + } + } + + return null; + + } + +}