Package org.erlide.ui.editors.erl

Examples of org.erlide.ui.editors.erl.SimpleSelectionProvider


            if (editor != null) {
                final OpenDeclarationAction openDeclarationAction = new OpenDeclarationAction(
                        control, editor);
                tbm.add(openDeclarationAction);

                final SimpleSelectionProvider selectionProvider = new SimpleSelectionProvider();
                final OpenEdocInExternalBrowserAction openEdocInExternalBrowserAction = new OpenEdocInExternalBrowserAction(
                        editor.getSite(), null);
                openEdocInExternalBrowserAction
                        .setSpecialSelectionProvider(selectionProvider);
                selectionProvider
                        .addSelectionChangedListener(openEdocInExternalBrowserAction);
                final ImageDescriptor descriptor = ErlideImage.OBJS_EXTERNALBROWSER
                        .getDescriptor();
                openEdocInExternalBrowserAction.setImageDescriptor(descriptor);
                openEdocInExternalBrowserAction.setDisabledImageDescriptor(descriptor);
                selectionProvider.setSelection(new StructuredSelection());
                tbm.add(openEdocInExternalBrowserAction);

                // OpenExternalBrowserAction openExternalJavadocAction = new
                // OpenExternalBrowserAction(
                // parent.getDisplay(), selectionProvider);
                // selectionProvider
                // .addSelectionChangedListener(openExternalJavadocAction);
                // selectionProvider.setSelection(new
                // StructuredSelection());
                // tbm.add(openExternalJavadocAction);

                final IInputChangedListener inputChangeListener = new IInputChangedListener() {
                    @Override
                    public void inputChanged(final Object newInput) {
                        backAction.update();
                        forwardAction.update();
                        if (newInput == null) {
                            selectionProvider.setSelection(new StructuredSelection());
                        } else if (newInput instanceof BrowserInformationControlInput) {
                            final BrowserInformationControlInput input = (BrowserInformationControlInput) newInput;
                            final Object inputElement = input.getInputElement();
                            selectionProvider.setSelection(new StructuredSelection(
                                    inputElement));
                            final boolean hasInputElement = inputElement != null;
                            showInEdocViewAction.setEnabled(hasInputElement);
                            openDeclarationAction.setEnabled(hasInputElement);
                            openEdocInExternalBrowserAction.setInput(newInput);
View Full Code Here

TOP

Related Classes of org.erlide.ui.editors.erl.SimpleSelectionProvider

Copyright © 2018 www.massapicom. 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.