Examples of WorkbenchCorePlugin


Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

     * Creates permanent GUI elements (source, algorithm combos, placeholder for the
     * editors).
     */
    private void createComponents(Composite parent)
    {
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();
        parent.setLayout(new FillLayout());

        this.scroller = new CScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
        scroller.setExpandHorizontal(true);
        scroller.setExpandVertical(false);

        final Composite innerComposite = GUIFactory.createSpacer(scroller);
        final GridLayout gridLayout = (GridLayout) innerComposite.getLayout();
        gridLayout.numColumns = 2;
        gridLayout.makeColumnsEqualWidth = false;

        scroller.setContent(innerComposite);

        // Initialize sources, descriptors and source combo.
        final ProcessingComponentSuite suite = core.getComponentSuite();

        sourceViewer = createComboViewer(innerComposite, "Source", suite.getSources());
        sourceViewer.addSelectionChangedListener(sourceSelectionListener);

        sources = Maps.newHashMap();
View Full Code Here

Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

     * to only {@link Input} and {@link Processing} attributes.
     */
    @SuppressWarnings("unchecked")
    private void addFilteredDescriptor(ProcessingComponentDescriptor e)
    {
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();

        descriptors.put(e.getId(),
            core.getComponentDescriptor(e.getId()).only(
                Input.class, Processing.class));       
    }
View Full Code Here

Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

        memento.createChild(SOURCE_ELEMENT).putString(ID_ATTRIBUTE, search.getSourceId());
        memento.createChild(ALGORITHM_ELEMENT).putString(ID_ATTRIBUTE,
            search.getAlgorithmId());
        try
        {
            final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();

            /*
             * Limit saved attributes to @Input and @Processing ones.
             */
            final Map<String, Object> actual = search.getAttributeValueSet()
                .getAttributeValues();
            final AttributeValueSet filtered = new AttributeValueSet("memento-saved");

            final BindableDescriptor input = core.getComponentDescriptor(
                search.getSourceId()).flatten().only(Input.class, Processing.class);
            for (String key : input.attributeDescriptors.keySet())
            {
                if (actual.containsKey(key))
                {
                    filtered.setAttributeValue(key, actual.get(key));
                }
            }

            final BindableDescriptor algorithm = core.getComponentDescriptor(
                search.getAlgorithmId()).flatten().only(Input.class, Processing.class);
            for (String key : algorithm.attributeDescriptors.keySet())
            {
                if (actual.containsKey(key))
                {
View Full Code Here

Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

     * Get hold of the algorithm instance, extract its attribute descriptors.
     */
    @SuppressWarnings("unchecked")
    BindableDescriptor getAlgorithmDescriptor()
    {
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();
        final String algorithmID = getSearchResult().getInput().getAlgorithmId();

        BindableDescriptor componentDescriptor = core.getComponentDescriptor(algorithmID);
        if (componentDescriptor == null) {
            throw new RuntimeException("No descriptor for algorithm: " + algorithmID);
        }
        return componentDescriptor.only(Input.class,
            Processing.class).only(Predicates.not(new InternalAttributePredicate(false)));
View Full Code Here

Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

     */
    @Override
    protected IStatus run(IProgressMonitor monitor)
    {
        final SearchInput searchInput = searchResult.getInput();
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();

        final ProcessingComponentDescriptor source = core.getComponent(searchInput.getSourceId());
        final ProcessingComponentDescriptor algorithm = core.getComponent(searchInput.getAlgorithmId());
   
        IStatus status;
        monitor.beginTask("Processing: "
            + source.getLabel() + " -> " + algorithm.getLabel(), IProgressMonitor.UNKNOWN);

        try
        {
            final Map<String, Object> attributes =
                searchInput.getAttributeValueSet().getAttributeValues();

            final Controller controller = core.getController();

            final ProcessingResult result = controller.process(
                attributes, source.getId(), algorithm.getId());

            PlatformUI.getWorkbench().getDisplay().syncExec(
View Full Code Here

Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

    /**
     * Return the benchmark runner.
     */
    private Callable<Long> createBenchmarkRunner()
    {
        final WorkbenchCorePlugin core = WorkbenchCorePlugin.getDefault();
        final Controller controller = core.getController();

        final ProcessingComponentDescriptor source = core.getComponent(input.getSourceId());
        final ProcessingComponentDescriptor algorithm = core.getComponent(input.getAlgorithmId());
       
        final Map<String, Object> attributes =
            Maps.newHashMap(input.getAttributeValueSet().getAttributeValues());
       
        return new Callable<Long>() {
View Full Code Here

Examples of org.carrot2.workbench.core.WorkbenchCorePlugin

    @Override
    public Object execute(ExecutionEvent event)
    {
        try
        {
            final WorkbenchCorePlugin wbCore = WorkbenchCorePlugin.getDefault();
            URL index = FileLocator.find(wbCore.getBundle(),
                new Path(WELCOME_INDEX_PATH), null);

            if (index != null)
            {
                index = FileLocator.toFileURL(index);

                IWebBrowser browser = wbCore.getWorkbench().getBrowserSupport()
                    .createBrowser(
                        IWorkbenchBrowserSupport.AS_EDITOR | IWorkbenchBrowserSupport.NAVIGATION_BAR,
                        BROWSER_ID, null, null);
               
                browser.openURL(index);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.