/******************************************************************************* * 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.proconf.g3d.actions; import java.util.ArrayList; import java.util.List; import org.simantics.utils.ui.plugin.Extension; import org.simantics.utils.ui.plugin.ExtensionLoader; public class ContextActionRegistry { /* private static ContextActionRegistry instance; public final static String ELEMENT_NAME = "ContextAction"; public final static String NAME_SPACE = "org.simantics.proconf.g3d"; public final static String EP_NAME = "contextaction"; private ExtensionLoader loader; private ContextActionRegistry() { loader = new ExtensionLoader(ELEMENT_NAME, NAME_SPACE, EP_NAME); } public static ContextActionRegistry getInstance() { if (instance==null) instance = new ContextActionRegistry(); return instance; } public Extension[] getExtensions() { return loader.getExtensions(); } public static ContextActionFactory[] getActions(String editorID) { List list = new ArrayList(); for (Extension e : getInstance().getExtensions()) { if(e.getStringField("editorid").compareTo(editorID) == 0) { list.add(e.getInstance()); } } return list.toArray(new ContextActionFactory[0]); } */ }