X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=bundles%2Forg.simantics.modeling.ui%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2Fui%2FmodelBrowser%2Fhandlers%2FActivateFilterHandler.java;h=8ed72033e16cfdef9b389d056648388ffcc93497;hb=21f12e54fc7907e26e49f26f95ee3b62cbecdc61;hp=36136c305ced92bd57136283866232f0b0a8a44c;hpb=969bd23cab98a79ca9101af33334000879fb60c5;p=simantics%2Fplatform.git diff --git a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/ActivateFilterHandler.java b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/ActivateFilterHandler.java index 36136c305..8ed72033e 100644 --- a/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/ActivateFilterHandler.java +++ b/bundles/org.simantics.modeling.ui/src/org/simantics/modeling/ui/modelBrowser/handlers/ActivateFilterHandler.java @@ -1,43 +1,43 @@ -/******************************************************************************* - * Copyright (c) 2007, 2010 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.modeling.ui.modelBrowser.handlers; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.handlers.HandlerUtil; -import org.simantics.browsing.ui.common.views.IFilterArea; -import org.simantics.browsing.ui.common.views.IFilterAreaProvider; - -public class ActivateFilterHandler extends AbstractHandler { - - @Override - public Object execute(ExecutionEvent event) throws ExecutionException { - IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); - IFilterAreaProvider fap = null; - if (part instanceof IFilterAreaProvider) - fap = (IFilterAreaProvider) part; - if (fap == null) - fap = (IFilterAreaProvider) part.getAdapter(IFilterAreaProvider.class); - if (fap == null) - return null; - - IFilterArea fa = fap.getFilterArea(); - if (fa == null) - return null; - - fa.focus(); - return null; - } - -} +/******************************************************************************* + * Copyright (c) 2007, 2010 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.modeling.ui.modelBrowser.handlers; + +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; +import org.eclipse.ui.IWorkbenchPart; +import org.eclipse.ui.handlers.HandlerUtil; +import org.simantics.browsing.ui.common.views.IFilterArea; +import org.simantics.browsing.ui.common.views.IFilterAreaProvider; + +public class ActivateFilterHandler extends AbstractHandler { + + @Override + public Object execute(ExecutionEvent event) throws ExecutionException { + IWorkbenchPart part = HandlerUtil.getActivePartChecked(event); + IFilterAreaProvider fap = null; + if (part instanceof IFilterAreaProvider) + fap = (IFilterAreaProvider) part; + if (fap == null) + fap = (IFilterAreaProvider) part.getAdapter(IFilterAreaProvider.class); + if (fap == null) + return null; + + IFilterArea fa = fap.getFilterArea(); + if (fa == null) + return null; + + fa.focus(); + return null; + } + +}