X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.browsing.ui.swt%2Fsrc%2Forg%2Fsimantics%2Fbrowsing%2Fui%2Fswt%2FDefaultImageDecoratorsProcessor.java;h=c833ba712f8ee5bb6efdca2f773cf2789087fee6;hp=81bbd04d6f0242c4a7b8cb3f03a99ff9828b9a00;hb=0ae2b770234dfc3cbb18bd38f324125cf0faca07;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DefaultImageDecoratorsProcessor.java b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DefaultImageDecoratorsProcessor.java index 81bbd04d6..c833ba712 100644 --- a/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DefaultImageDecoratorsProcessor.java +++ b/bundles/org.simantics.browsing.ui.swt/src/org/simantics/browsing/ui/swt/DefaultImageDecoratorsProcessor.java @@ -1,56 +1,56 @@ -/******************************************************************************* - * 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.browsing.ui.swt; - -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; - -import org.simantics.browsing.ui.BuiltinKeys; -import org.simantics.browsing.ui.BuiltinKeys.ImageDecoratorKey; -import org.simantics.browsing.ui.NodeContext; -import org.simantics.browsing.ui.NodeContext.QueryKey; -import org.simantics.browsing.ui.NodeQueryManager; -import org.simantics.browsing.ui.common.processors.AbstractNodeQueryProcessor; -import org.simantics.browsing.ui.content.ImageDecorator; -import org.simantics.browsing.ui.content.ImageDecoratorFactory; - -public class DefaultImageDecoratorsProcessor extends AbstractNodeQueryProcessor> { - - @Override - public Collection query(NodeQueryManager manager, NodeContext context) { - Collection factories = manager.query(context, BuiltinKeys.SELECTED_IMAGE_DECORATOR_FACTORIES); - if (factories.isEmpty()) - return Collections.emptyList(); - - Collection decorators = new ArrayList(factories.size()); - for (ImageDecoratorFactory f : factories) { - assert f != null; - ImageDecorator decorator = manager.query(context, new ImageDecoratorKey(f)); - if (decorator != null) - decorators.add(decorator); - } - - return decorators; - } - - @Override - public String toString() { - return "ImageDecoratorsProcessor"; - } - - @Override - public QueryKey> getIdentifier() { - return BuiltinKeys.IMAGE_DECORATORS; - } - -} +/******************************************************************************* + * 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.browsing.ui.swt; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; + +import org.simantics.browsing.ui.BuiltinKeys; +import org.simantics.browsing.ui.BuiltinKeys.ImageDecoratorKey; +import org.simantics.browsing.ui.NodeContext; +import org.simantics.browsing.ui.NodeContext.QueryKey; +import org.simantics.browsing.ui.NodeQueryManager; +import org.simantics.browsing.ui.common.processors.AbstractNodeQueryProcessor; +import org.simantics.browsing.ui.content.ImageDecorator; +import org.simantics.browsing.ui.content.ImageDecoratorFactory; + +public class DefaultImageDecoratorsProcessor extends AbstractNodeQueryProcessor> { + + @Override + public Collection query(NodeQueryManager manager, NodeContext context) { + Collection factories = manager.query(context, BuiltinKeys.SELECTED_IMAGE_DECORATOR_FACTORIES); + if (factories.isEmpty()) + return Collections.emptyList(); + + Collection decorators = new ArrayList(factories.size()); + for (ImageDecoratorFactory f : factories) { + assert f != null; + ImageDecorator decorator = manager.query(context, new ImageDecoratorKey(f)); + if (decorator != null) + decorators.add(decorator); + } + + return decorators; + } + + @Override + public String toString() { + return "ImageDecoratorsProcessor"; + } + + @Override + public QueryKey> getIdentifier() { + return BuiltinKeys.IMAGE_DECORATORS; + } + +}