public ConsoleFactoryExtension[] getConsoleFactoryExtensions() { if (fConsoleFactoryExtensions == null) { fConsoleFactoryExtensions = new ArrayList(); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.EXTENSION_POINT_CONSOLE_FACTORIES); IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements(); for (int i = 0; i < configurationElements.length; i++) { fConsoleFactoryExtensions.add(new ConsoleFactoryExtension(configurationElements[i])); } } return (ConsoleFactoryExtension[]) fConsoleFactoryExtensions.toArray(new ConsoleFactoryExtension[0]); }
public void run() { try { if (fFactory == null) { fFactory = fConfig.createFactory(); } fFactory.openConsole(); } catch (CoreException e) { ConsolePlugin.log(e); } }
@Override public Menu getMenu(Control parent) { if (fMenu != null) { fMenu.dispose(); } fMenu= new Menu(parent); int accel = 1; for (int i = 0; i < fFactoryExtensions.length; i++) { ConsoleFactoryExtension extension = fFactoryExtensions[i]; if (!WorkbenchActivityHelper.filterItem(extension) && extension.isEnabled()) { String label = extension.getLabel(); ImageDescriptor image = extension.getImageDescriptor(); addActionToMenu(fMenu, new ConsoleFactoryAction(label, image, extension), accel); accel++; } } return fMenu; }
public ImageDescriptor getImageDescriptor() { if (fImageDescriptor == null) { String path = fConfig.getAttribute("icon"); //$NON-NLS-1$ if (path != null) { Bundle bundle = Platform.getBundle(getPluginId()); URL url = FileLocator.find(bundle, new Path(path), null); if (url != null) { fImageDescriptor = ImageDescriptor.createFromURL(url); } } } return fImageDescriptor; }
public boolean isEnabled() { try { Expression enablementExpression = getEnablementExpression(); if (enablementExpression == null) { return true; } EvaluationContext context = new EvaluationContext(null, this); EvaluationResult evaluationResult = enablementExpression.evaluate(context); return evaluationResult != EvaluationResult.FALSE; } catch (CoreException e) { ConsolePlugin.log(e); return false; } }
/** * @return */ public ImageDescriptor getImageDescriptor() { if (fImageDescriptor == null) { String path = fConfig.getAttribute("icon"); //$NON-NLS-1$ if (path != null) { Bundle bundle = Platform.getBundle(getPluginId()); URL url = FileLocator.find(bundle, new Path(path), null); if (url != null) { fImageDescriptor = ImageDescriptor.createFromURL(url); } } } return fImageDescriptor; }
public boolean isEnabled() { try { Expression enablementExpression = getEnablementExpression(); if (enablementExpression == null) { return true; } EvaluationContext context = new EvaluationContext(null, this); EvaluationResult evaluationResult = enablementExpression.evaluate(context); return evaluationResult != EvaluationResult.FALSE; } catch (CoreException e) { ConsolePlugin.log(e); return false; } }
public Menu getMenu(Control parent) { if (fMenu != null) { fMenu.dispose(); } fMenu= new Menu(parent); int accel = 1; for (int i = 0; i < fFactoryExtensions.length; i++) { ConsoleFactoryExtension extension = fFactoryExtensions[i]; if (!WorkbenchActivityHelper.filterItem(extension) && extension.isEnabled()) { String label = extension.getLabel(); ImageDescriptor image = extension.getImageDescriptor(); addActionToMenu(fMenu, new ConsoleFactoryAction(label, image, extension), accel); accel++; } } return fMenu; }
@Override public void run() { try { if (fFactory == null) { fFactory = fConfig.createFactory(); } fFactory.openConsole(); } catch (CoreException e) { ConsolePlugin.log(e); } }
public ConsoleFactoryExtension[] getConsoleFactoryExtensions() { if (fConsoleFactoryExtensions == null) { fConsoleFactoryExtensions = new ArrayList<ConsoleFactoryExtension>(); IExtensionPoint extensionPoint = Platform.getExtensionRegistry().getExtensionPoint(ConsolePlugin.getUniqueIdentifier(), IConsoleConstants.EXTENSION_POINT_CONSOLE_FACTORIES); IConfigurationElement[] configurationElements = extensionPoint.getConfigurationElements(); for (int i = 0; i < configurationElements.length; i++) { fConsoleFactoryExtensions.add(new ConsoleFactoryExtension(configurationElements[i])); } } return fConsoleFactoryExtensions.toArray(new ConsoleFactoryExtension[0]); }