From: Marko Luukkainen Date: Wed, 23 Oct 2019 07:41:50 +0000 (+0300) Subject: Remove old g3d toolbar implementation. X-Git-Tag: v1.43.0~179 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=e4bb363787bb31f087a71b646eb8f05646c1455e;p=simantics%2F3d.git Remove old g3d toolbar implementation. Current implementation is simantics.ui.toolbar gitlab #38 Change-Id: I3ff0671f5e074d91bac5b4ef160dc7daaef092c8 --- diff --git a/org.simantics.g3d/META-INF/MANIFEST.MF b/org.simantics.g3d/META-INF/MANIFEST.MF index 97772dc1..933d272f 100644 --- a/org.simantics.g3d/META-INF/MANIFEST.MF +++ b/org.simantics.g3d/META-INF/MANIFEST.MF @@ -33,7 +33,6 @@ Export-Package: org.simantics.g3d, org.simantics.g3d.scenegraph.structural, org.simantics.g3d.scl, org.simantics.g3d.shape, - org.simantics.g3d.toolbar, org.simantics.g3d.tools, org.simantics.g3d.ui, org.simantics.g3d.wizard diff --git a/org.simantics.g3d/plugin.xml b/org.simantics.g3d/plugin.xml index 588b8fbe..b93b3db8 100644 --- a/org.simantics.g3d/plugin.xml +++ b/org.simantics.g3d/plugin.xml @@ -12,7 +12,6 @@ --> - - - - - - - - - [Enter description of this extension point.] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Used with radio buttons. - - - - - - - - - - - - - - - - - - - - - - [Enter the first release in which this extension point appears.] - - - - - - - - - [Enter extension point usage example here.] - - - - - - - - - [Enter API information here.] - - - - - - - - - [Enter information about supplied implementation of this extension point.] - - - - - diff --git a/org.simantics.g3d/src/org/simantics/g3d/toolbar/CommandStateRegistry.java b/org.simantics.g3d/src/org/simantics/g3d/toolbar/CommandStateRegistry.java deleted file mode 100644 index c9dab6fa..00000000 --- a/org.simantics.g3d/src/org/simantics/g3d/toolbar/CommandStateRegistry.java +++ /dev/null @@ -1,162 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 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.g3d.toolbar; - -import java.util.HashMap; -import java.util.Map; - -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.State; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.ui.handlers.RadioState; -import org.eclipse.ui.handlers.RegistryToggleState; - -/** - * Registry for storing command states separately for each IEditorPart - * - * TODO : how to change toggle/radios state from editor? - * TODO : how to update visible buttons (ToolbarContributor) - * - * @author Marko Luukkainen - * - */ -public class CommandStateRegistry { - - - private static CommandStateRegistry instance; - - - public static CommandStateRegistry getInstance() { - if (instance == null) - instance = new CommandStateRegistry(); - return instance; - } - - - - private Map> toggleStates = new HashMap>(); - private Map defaultToggleStates = new HashMap(); - - private Map defaultRadioStates = new HashMap(); - private Map> radioStates = new HashMap>(); - - private ICommandService service; - private IHandlerService handlerService; - - private CommandStateRegistry() { - service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class); - handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class); - } - - /** - * Stores default state for a command. - * - * Note: uses current state as default. - * - * @param commandId - */ - public void storeDefaultState(String commandId) { - Command command = service.getCommand(commandId); - State toggleState = command.getState(RegistryToggleState.STATE_ID); - State radioState = command.getState(RadioState.STATE_ID); - if (toggleState != null) { - if (!defaultToggleStates.containsKey(commandId)) - defaultToggleStates.put(commandId, getToggleState(command)); - } else if (radioState != null) { - String value = (String) radioState.getValue(); - if (!defaultRadioStates.containsKey(commandId)) - defaultRadioStates.put(commandId, value); - } else { - throw new IllegalArgumentException("Command " + commandId + " does not have a state"); - } - } - /** - * Stores toggle state of a command. - * @param part - * @param commandId - * @param checked - */ - public void setEditorState(IWorkbenchPart part, String commandId, boolean checked) { - Map editorStates = toggleStates.get(part); - if (editorStates == null) { - editorStates = new HashMap(); - toggleStates.put(part, editorStates); - } - editorStates.put(commandId, checked); - } - - /** - * Stores radio state of a command. - * @param part - * @param commandId - * @param value - */ - public void setEditorState(IWorkbenchPart part, String commandId, String value) { - Map editorStates = radioStates.get(part); - if (editorStates == null) { - editorStates = new HashMap(); - radioStates.put(part, editorStates); - } - editorStates.put(commandId, value); - } - - public Map getDefaultToggleStates() { - return defaultToggleStates; - } - - public Map getDefaultRadioStates() { - return defaultRadioStates; - } - - public Map getEditorToggleStates(IWorkbenchPart part) { - return toggleStates.get(part); - } - - public Map getEditorRadioStates(IWorkbenchPart part) { - return radioStates.get(part); - } - - public Boolean getToggleState(IWorkbenchPart part, String commandId) { - if (part == null) - return defaultToggleStates.get(commandId); - Map editorStates = toggleStates.get(part); - if (editorStates == null) { - return defaultToggleStates.get(commandId); - } - return editorStates.get(commandId); - } - - public String getRadioState(IWorkbenchPart part, String commandId) { - if (part == null) - return defaultRadioStates.get(commandId); - Map editorStates = radioStates.get(part); - if (editorStates == null) { - return defaultRadioStates.get(commandId); - } - return editorStates.get(commandId); - } - - public void clearStates(IWorkbenchPart part) { - toggleStates.remove(part); - radioStates.remove(part); - } - - private boolean getToggleState(Command command) { - State toggleState = command.getState(RegistryToggleState.STATE_ID); - return (Boolean)toggleState.getValue(); - } - - -} diff --git a/org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolBarCommandRegistry.java b/org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolBarCommandRegistry.java deleted file mode 100644 index 97262a8d..00000000 --- a/org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolBarCommandRegistry.java +++ /dev/null @@ -1,137 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 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.g3d.toolbar; - -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; - -import org.eclipse.core.runtime.IConfigurationElement; -import org.eclipse.core.runtime.IExtension; -import org.eclipse.core.runtime.IExtensionPoint; -import org.eclipse.core.runtime.Platform; -import org.eclipse.core.runtime.dynamichelpers.ExtensionTracker; -import org.eclipse.core.runtime.dynamichelpers.IExtensionChangeHandler; -import org.eclipse.core.runtime.dynamichelpers.IExtensionTracker; -import org.eclipse.core.runtime.dynamichelpers.IFilter; -import org.simantics.g3d.Activator; - - - - - -public class ToolBarCommandRegistry implements IExtensionChangeHandler { - private final static String NAMESPACE = Activator.PLUGIN_ID; - - private final static String EP_NAME = "toolbarCommand"; - - private ExtensionTracker tracker; - - private List extensions = new ArrayList(); - - - private static ToolBarCommandRegistry INSTANCE; - - public static synchronized ToolBarCommandRegistry getInstance() { - if (INSTANCE == null) - INSTANCE = new ToolBarCommandRegistry(); - return INSTANCE; - } - - public static synchronized void dispose() { - if (INSTANCE != null) { - INSTANCE.close(); - INSTANCE = null; - } - } - - public ToolBarCommandRegistry() { - tracker = new ExtensionTracker(); - - IExtensionPoint ep = Platform.getExtensionRegistry().getExtensionPoint(NAMESPACE,EP_NAME); - loadExtensions(ep.getConfigurationElements()); - - IFilter filter = ExtensionTracker.createExtensionPointFilter(ep); - tracker.registerHandler(this, filter); - } - - private void close() { - tracker.close(); - tracker = null; - extensions.clear(); - } - - public synchronized List getExtensions() { - return Collections.unmodifiableList(extensions); - } - - private synchronized void loadExtensions(IConfigurationElement[] elements) { - for (IConfigurationElement el : elements) { - String commandId = el.getAttribute("commandId"); - - ToolbarCommandExtension ext = new ToolbarCommandExtension(commandId); - ext.toolbarId = el.getAttribute("toolbarId"); - ext.image = el.getAttribute("image"); - ext.name = el.getAttribute("name"); - ext.type = el.getAttribute("type"); - ext.value = el.getAttribute("value"); - ext.contributorId = el.getContributor().getName(); - tracker.registerObject(el.getDeclaringExtension(), ext, IExtensionTracker.REF_STRONG); - extensions.add(ext); - - } - } - - @Override - public void addExtension(IExtensionTracker tracker, IExtension extension) { - loadExtensions(extension.getConfigurationElements()); - } - - @Override - public synchronized void removeExtension(IExtension extension, Object[] objects) { - for (Object o : objects) { - ToolbarCommandExtension ext = (ToolbarCommandExtension) o; - tracker.unregisterObject(extension, ext); - extensions.remove(ext); - } - } - - public synchronized List getExtensions(String toolbarId) { - List list = new ArrayList(); - for (ToolbarCommandExtension ext : extensions) - if (ext.toolbarId.equals(toolbarId)) - list.add(ext); - return list; - - } - - public class ToolbarCommandExtension { - public String commandId; - public String toolbarId; - public String name; - public String type; - public String value; - public String image; - public String contributorId; - public ToolbarCommandExtension(String commandId) { - super(); - this.commandId = commandId; - } - - @Override - public String toString() { - return "ToolbarCommandExtension, commandId= " + commandId + " toolbarId= " + toolbarId + " type= " + type + " value= " + value + " contributor= " + contributorId; - } - } - - -} diff --git a/org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolbarContributor.java b/org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolbarContributor.java deleted file mode 100644 index 70fb9c6b..00000000 --- a/org.simantics.g3d/src/org/simantics/g3d/toolbar/ToolbarContributor.java +++ /dev/null @@ -1,493 +0,0 @@ -/******************************************************************************* - * Copyright (c) 2012, 2013 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.g3d.toolbar; - -import java.util.ArrayList; -import java.util.HashMap; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.eclipse.core.commands.Command; -import org.eclipse.core.commands.CommandEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.core.commands.ICommandListener; -import org.eclipse.core.commands.State; -import org.eclipse.jface.action.Action; -import org.eclipse.jface.action.ActionContributionItem; -import org.eclipse.jface.action.IContributionItem; -import org.eclipse.jface.action.ICoolBarManager; -import org.eclipse.jface.action.IToolBarManager; -import org.eclipse.jface.action.ToolBarContributionItem; -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.nebula.widgets.tablecombo.TableCombo; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.events.SelectionListener; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.TableItem; -import org.eclipse.ui.IEditorPart; -import org.eclipse.ui.IPartListener; -import org.eclipse.ui.IWorkbenchPart; -import org.eclipse.ui.PlatformUI; -import org.eclipse.ui.commands.ICommandService; -import org.eclipse.ui.handlers.HandlerUtil; -import org.eclipse.ui.handlers.IHandlerService; -import org.eclipse.ui.handlers.RadioState; -import org.eclipse.ui.handlers.RegistryToggleState; -import org.eclipse.ui.menus.WorkbenchWindowControlContribution; -import org.eclipse.ui.part.EditorActionBarContributor; -import org.simantics.db.common.utils.ErrorLogger; -import org.simantics.g3d.Activator; -import org.simantics.g3d.toolbar.ToolBarCommandRegistry.ToolbarCommandExtension; -import org.simantics.utils.datastructures.MapList; - - -/** - * EditorBarContributor, which tracks toggle states separately for each command. - * - * @see org.simantics.g3d.toolbarCommand Extension Point - * - * @author Marko Luukkainen - * - * - * - * TODO : test radio buttons. - * TODO : configuring the position of buttons. - * - */ -public abstract class ToolbarContributor extends EditorActionBarContributor implements ICommandListener, IPartListener { - - private static final String PLATFORM = "platform:/plugin/"; - - private IEditorPart activePart; - private Set parts = new HashSet(); - IToolBarManager mgr; - - - ICommandService service; - IHandlerService handlerService; - List items = new ArrayList(); - MapList actions = new MapList(); - - CommandStateRegistry stateRegistry; - - private Map menus = new HashMap(); - - public ToolbarContributor() { - service = (ICommandService) PlatformUI.getWorkbench().getService(ICommandService.class); - handlerService = (IHandlerService) PlatformUI.getWorkbench().getService(IHandlerService.class); - stateRegistry = CommandStateRegistry.getInstance(); - } - - public abstract String getToolbarId(); - - public void contributeToCoolBar(ICoolBarManager coolBarManager) { - IContributionItem toolBar = coolBarManager.find(getToolbarId()); - if (toolBar instanceof ToolBarContributionItem) - mgr = ((ToolBarContributionItem) toolBar).getToolBarManager(); - if (mgr == null) - return; - - createCommands(); - - mgr.markDirty(); - - } - - private void createCommands() { - for (ToolbarCommandExtension ext : ToolBarCommandRegistry.getInstance().getExtensions(getToolbarId())) { - addCommand(ext); - } - } - - private void addCommand(ToolbarCommandExtension ext) { - String commandId = ext.commandId; - Command command = service.getCommand(commandId); - - String type = ext.type; - - State toggleState = command.getState(RegistryToggleState.STATE_ID); - State radioState = command.getState(RadioState.STATE_ID); - - String name = ext.name; - - - ImageDescriptor image = getImage(ext); - - CommandAction a = null; - if (type.equals("toggle") && toggleState != null) { - a = new CommandCheckboxAction(command,name,image); - - stateRegistry.storeDefaultState(commandId); - } else if (radioState != null && ext.value != null) { - stateRegistry.storeDefaultState(commandId); - if (type.equals("radio")) { - a = new CommandRadioAction(command,name,ext.value,image); - } else if (type.equals("combo")) { - a = new CommandRadioAction(command,name,ext.value,image); - ComboContribution combo = menus.get(commandId); - if (combo == null) { - combo = new ComboContribution(); - menus.put(commandId, combo); - items.add(combo); - mgr.add(combo); - a.getCommand().addCommandListener(this); - } - actions.add(commandId,a); - combo.addAction(a); - return; - } - } else if (type.equals("push")) { - a = new CommandPushAction(command,name,image); - } else { - ErrorLogger.defaultLogError(ext + " is not valid."); - return; - } - a.getCommand().addCommandListener(this); - IContributionItem item = new ActionContributionItem(a); - actions.add(commandId,a); - items.add(item); - mgr.add(item); - } - - private ImageDescriptor getImage(ToolbarCommandExtension ext) { - ImageDescriptor image = null; - if (ext.image != null) { - String plugin = null; - String file = null; - if (ext.image.startsWith(PLATFORM)) { - String s = ext.image.substring(PLATFORM.length()); - int i = s.indexOf("/"); - plugin = s.substring(0,i); - file = s.substring(i+1); - } else { - plugin = ext.contributorId; - file = ext.image; - } - image = Activator.imageDescriptorFromPlugin(plugin, file); - } - return image; - } - - - - @Override - public void commandChanged(CommandEvent commandEvent) { - if (commandEvent.isHandledChanged()||commandEvent.isEnabledChanged()) { - Command command = commandEvent.getCommand(); - String commandId = command.getId(); - for (CommandAction a : actions.getValues(commandId)) { - a.setEnabled(command.isHandled() && command.isEnabled()); - } - } - } - - @Override - public void setActiveEditor(IEditorPart targetEditor) { - if (targetEditor == activePart) - return; - setContext(targetEditor); - } - - private void setContext(IEditorPart part) { - this.activePart = part; - if (!parts.contains(activePart)) { - activePart.getSite().getPage().addPartListener(this); - } - if (part != null) { - for (String commandId : actions.getKeys()) { - for (CommandAction a : actions.getValues(commandId)) { - a.setEnabled(true); - } - } - updateActionBars(part); - } else { - for (String commandId : actions.getKeys()) { - for (CommandAction a : actions.getValues(commandId)) { - a.setEnabled(false); - } - } - } - } - - private void updateActionBars(IEditorPart part) { - restoreActionStates(); - part.getEditorSite().getActionBars().updateActionBars(); - } - - @Override - public void dispose() { - if (mgr != null) { - for (IContributionItem item : items) { - mgr.remove(item); - item.dispose(); - } - mgr.markDirty(); - mgr.update(true); - if (activePart != null) { - activePart.getEditorSite().getActionBars().updateActionBars(); - } - - for (String commandId : actions.getKeys()) { - for (CommandAction a : actions.getValues(commandId)) { - a.getCommand().removeCommandListener(this); - } - } - actions.clear(); - } - - super.dispose(); - activePart = null; - } - - - private void storeRadioActionState(CommandRadioAction action, boolean checked) { - if (activePart == null) - return; - stateRegistry.setEditorState(activePart, action.getCommandId(), action.getValue()); - } - - private void storeToggleActionState(CommandAction action, boolean checked) { - if (activePart == null) - return; - stateRegistry.setEditorState(activePart, action.getCommandId(), checked); - } - - private void restoreActionStates() { - if (activePart == null) - return; - // toggles - Map defaultToggleStates = stateRegistry.getDefaultToggleStates(); - for (String commandId : defaultToggleStates.keySet()) { - for (CommandAction a : actions.getValues(commandId)) { - a.setChecked(defaultToggleStates.get(commandId)); - } - } - Map editorStates = stateRegistry.getEditorToggleStates(activePart);//toggleStates.get(activePart); - if (editorStates != null) { - for (String commandId : editorStates.keySet()) { - for (CommandAction a : actions.getValues(commandId)) { - a.setChecked(editorStates.get(commandId)); - } - } - } - // radios - Map defaultRadioStates = stateRegistry.getDefaultRadioStates(); - for (String commandId : defaultRadioStates.keySet()) { - String defaultValue = defaultRadioStates.get(commandId); - for (CommandAction a : actions.getValues(commandId)) { - CommandRadioAction r = (CommandRadioAction)a; - r.setChecked(r.getValue().equals(defaultValue)); - } - } - - Map editorRadioStates = stateRegistry.getEditorRadioStates(activePart);//radioStates.get(activePart); - if (editorRadioStates != null) { - for (String commandId : editorRadioStates.keySet()) { - String defaultValue = editorRadioStates.get(commandId); - for (CommandAction a : actions.getValues(commandId)) { - CommandRadioAction r = (CommandRadioAction)a; - r.setChecked(r.getValue().equals(defaultValue)); - } - } - } - - for (ComboContribution c : menus.values()) { - c.updateSelection(); - } - - - } - - @Override - public void partActivated(IWorkbenchPart part) { - - } - - @Override - public void partBroughtToTop(IWorkbenchPart part) { - - } - - @Override - public void partClosed(IWorkbenchPart part) { - parts.remove(part); - stateRegistry.clearStates(part); - part.getSite().getPage().removePartListener(this); - } - - @Override - public void partDeactivated(IWorkbenchPart part) { - - } - - @Override - public void partOpened(IWorkbenchPart part) { - - } - - private boolean getToggleState(Command command) { - State toggleState = command.getState(RegistryToggleState.STATE_ID); - return (Boolean)toggleState.getValue(); - } - - private abstract class CommandAction extends Action { - private Command command; - - public CommandAction(Command command, String name, ImageDescriptor image, int style) { - super(name,style); - this.command = command; - if (image != null) - setImageDescriptor(image); - } - - @Override - public void run() { - try { - handlerService.executeCommand(command.getId(), null); - } catch (Exception e) { - e.printStackTrace(); - } - } - - public Command getCommand() { - return command; - } - - public String getCommandId() { - return command.getId(); - } - } - - private class CommandCheckboxAction extends CommandAction { - - public CommandCheckboxAction(Command command, String name, ImageDescriptor image) { - super(command,name,image,Action.AS_CHECK_BOX); - - } - - @Override - public void run() { - boolean checked = isChecked(); - storeToggleActionState(this, checked); - try { - if (checked == getToggleState(getCommand())) - HandlerUtil.toggleCommandState(getCommand()); - } catch (ExecutionException e) { - e.printStackTrace(); - } - super.run(); - } - - } - - private class CommandRadioAction extends CommandAction { - - private String value; - - public CommandRadioAction(Command command, String name, String value, ImageDescriptor image) { - super(command,name,image,Action.AS_RADIO_BUTTON); - this.value = value; - } - - @Override - public void run() { - boolean checked = isChecked(); - storeRadioActionState(this, checked); - try { - HandlerUtil.updateRadioState(getCommand(), value); - } catch (ExecutionException e) { - e.printStackTrace(); - return; - } - super.run(); - } - - public String getValue() { - return value; - } - - } - - private class CommandPushAction extends CommandAction { - - public CommandPushAction(Command command, String name, ImageDescriptor image) { - super(command,name,image,Action.AS_PUSH_BUTTON); - } - - } - - private class ComboContribution extends WorkbenchWindowControlContribution { - private TableCombo combo; - - private List actions = new ArrayList(); - - @Override - protected Control createControl(Composite parent) { - Composite container = new Composite(parent, SWT.NONE); - GridLayout glContainer = new GridLayout(1, false); - glContainer.marginTop = 0; - glContainer.marginHeight = 0; - glContainer.marginWidth = 0; - container.setLayout(glContainer); - GridData glReader = new GridData(SWT.FILL, SWT.FILL, false, false, 1, 1); - combo = new TableCombo(container, SWT.BORDER | SWT.READ_ONLY); - combo.setLayoutData(glReader); - - for (Action a : actions) { - TableItem item = new TableItem(combo.getTable(), SWT.NONE); - item.setText(a.getText()); - if (a.getImageDescriptor() != null) - item.setImage(a.getImageDescriptor().createImage()); - } - - combo.addSelectionListener(new SelectionListener() { - - @Override - public void widgetSelected(SelectionEvent e) { - int index = combo.getSelectionIndex(); - if (index == -1) - return; - actions.get(index).run(); - } - - @Override - public void widgetDefaultSelected(SelectionEvent e) { - - } - }); - updateSelection(); - return container; - } - - public void addAction(Action a) { - actions.add(a); - } - - void updateSelection() { - if (combo == null) - return; - for (int i = 0; i < actions.size(); i++) { - if (actions.get(i).isChecked()) { - combo.select(i); - return; - } - } - } - } - -}