Search in sources :

Example 46 with IStatusLineManager

use of org.eclipse.jface.action.IStatusLineManager in project liferay-ide by liferay.

the class FormEntryAdapter method linkExited.

/**
 * (non-Javadoc)
 * @see
 * org.eclipse.ui.forms.events.HyperlinkListener#linkExited(org.eclipse.ui.
 * forms.events.HyperlinkEvent)
 */
public void linkExited(HyperlinkEvent e) {
    if (actionBars == null) {
        return;
    }
    IStatusLineManager mng = actionBars.getStatusLineManager();
    mng.setMessage(null);
}
Also used : IStatusLineManager(org.eclipse.jface.action.IStatusLineManager)

Example 47 with IStatusLineManager

use of org.eclipse.jface.action.IStatusLineManager in project liferay-ide by liferay.

the class IDEFormEditor method getProgressMonitor.

/**
 * @return
 */
protected IProgressMonitor getProgressMonitor() {
    IProgressMonitor monitor = null;
    IStatusLineManager manager = getStatusLineManager();
    if (manager != null) {
        monitor = manager.getProgressMonitor();
    }
    if (monitor == null) {
        monitor = new NullProgressMonitor();
    }
    return monitor;
}
Also used : NullProgressMonitor(org.eclipse.core.runtime.NullProgressMonitor) IProgressMonitor(org.eclipse.core.runtime.IProgressMonitor) IStatusLineManager(org.eclipse.jface.action.IStatusLineManager)

Example 48 with IStatusLineManager

use of org.eclipse.jface.action.IStatusLineManager in project tdq-studio-se by Talend.

the class SQLEditor method updateCursorPosition.

/**
 * Updates the cursor position info in the status bar
 */
public void updateCursorPosition() {
    Object adapter = textEditor.getAdapter(org.eclipse.swt.widgets.Control.class);
    if (adapter instanceof StyledText) {
        StyledText text = (StyledText) adapter;
        int offset = text.getCaretOffset();
        int lineNo = text.getLineAtOffset(offset);
        int lineOffset = text.getOffsetAtLine(lineNo);
        int charNo = offset - lineOffset;
        IStatusLineManager manager = getEditorSite().getActionBars().getStatusLineManager();
        IContributionItem[] items = manager.getItems();
        for (IContributionItem item : items) {
            if (item instanceof CursorPositionContrib) {
                CursorPositionContrib contrib = (CursorPositionContrib) item;
                contrib.setPosition(lineNo + 1, charNo + 1);
                break;
            }
        }
    }
}
Also used : StyledText(org.eclipse.swt.custom.StyledText) IStatusLineManager(org.eclipse.jface.action.IStatusLineManager) IContributionItem(org.eclipse.jface.action.IContributionItem) Point(org.eclipse.swt.graphics.Point)

Example 49 with IStatusLineManager

use of org.eclipse.jface.action.IStatusLineManager in project Malai by arnobl.

the class ActionEditor method getContentOutlinePage.

/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
    if (contentOutlinePage == null) {
        // 
        class MyContentOutlinePage extends ContentOutlinePage {

            @Override
            public void createControl(Composite parent) {
                super.createControl(parent);
                contentOutlineViewer = getTreeViewer();
                contentOutlineViewer.addSelectionChangedListener(this);
                // Set up the tree viewer.
                // 
                contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
                contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
                contentOutlineViewer.setInput(editingDomain.getResourceSet());
                // Make sure our popups work.
                // 
                createContextMenuFor(contentOutlineViewer);
                if (!editingDomain.getResourceSet().getResources().isEmpty()) {
                    // Select the root object in the view.
                    // 
                    contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
                }
            }

            @Override
            public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
                super.makeContributions(menuManager, toolBarManager, statusLineManager);
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars(IActionBars actionBars) {
                super.setActionBars(actionBars);
                getActionBarContributor().shareGlobalActions(this, actionBars);
            }
        }
        contentOutlinePage = new MyContentOutlinePage();
        // Listen to selection so that we can handle it is a special way.
        // 
        contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {

            // This ensures that we handle selections correctly.
            // 
            public void selectionChanged(SelectionChangedEvent event) {
                handleContentOutlineSelection(event.getSelection());
            }
        });
    }
    return contentOutlinePage;
}
Also used : ContentOutlinePage(org.eclipse.ui.views.contentoutline.ContentOutlinePage) IContentOutlinePage(org.eclipse.ui.views.contentoutline.IContentOutlinePage) Composite(org.eclipse.swt.widgets.Composite) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IStatusLineManager(org.eclipse.jface.action.IStatusLineManager) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) AdapterFactoryContentProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IMenuManager(org.eclipse.jface.action.IMenuManager) IActionBars(org.eclipse.ui.IActionBars)

Example 50 with IStatusLineManager

use of org.eclipse.jface.action.IStatusLineManager in project Malai by arnobl.

the class InteractionEditor method getContentOutlinePage.

/**
 * This accesses a cached version of the content outliner.
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public IContentOutlinePage getContentOutlinePage() {
    if (contentOutlinePage == null) {
        // 
        class MyContentOutlinePage extends ContentOutlinePage {

            @Override
            public void createControl(Composite parent) {
                super.createControl(parent);
                contentOutlineViewer = getTreeViewer();
                contentOutlineViewer.addSelectionChangedListener(this);
                // Set up the tree viewer.
                // 
                contentOutlineViewer.setContentProvider(new AdapterFactoryContentProvider(adapterFactory));
                contentOutlineViewer.setLabelProvider(new AdapterFactoryLabelProvider(adapterFactory));
                contentOutlineViewer.setInput(editingDomain.getResourceSet());
                // Make sure our popups work.
                // 
                createContextMenuFor(contentOutlineViewer);
                if (!editingDomain.getResourceSet().getResources().isEmpty()) {
                    // Select the root object in the view.
                    // 
                    contentOutlineViewer.setSelection(new StructuredSelection(editingDomain.getResourceSet().getResources().get(0)), true);
                }
            }

            @Override
            public void makeContributions(IMenuManager menuManager, IToolBarManager toolBarManager, IStatusLineManager statusLineManager) {
                super.makeContributions(menuManager, toolBarManager, statusLineManager);
                contentOutlineStatusLineManager = statusLineManager;
            }

            @Override
            public void setActionBars(IActionBars actionBars) {
                super.setActionBars(actionBars);
                getActionBarContributor().shareGlobalActions(this, actionBars);
            }
        }
        contentOutlinePage = new MyContentOutlinePage();
        // Listen to selection so that we can handle it is a special way.
        // 
        contentOutlinePage.addSelectionChangedListener(new ISelectionChangedListener() {

            // This ensures that we handle selections correctly.
            // 
            public void selectionChanged(SelectionChangedEvent event) {
                handleContentOutlineSelection(event.getSelection());
            }
        });
    }
    return contentOutlinePage;
}
Also used : ContentOutlinePage(org.eclipse.ui.views.contentoutline.ContentOutlinePage) IContentOutlinePage(org.eclipse.ui.views.contentoutline.IContentOutlinePage) Composite(org.eclipse.swt.widgets.Composite) IToolBarManager(org.eclipse.jface.action.IToolBarManager) IStatusLineManager(org.eclipse.jface.action.IStatusLineManager) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) StructuredSelection(org.eclipse.jface.viewers.StructuredSelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) AdapterFactoryContentProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider) AdapterFactoryLabelProvider(org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider) SelectionChangedEvent(org.eclipse.jface.viewers.SelectionChangedEvent) IMenuManager(org.eclipse.jface.action.IMenuManager) IActionBars(org.eclipse.ui.IActionBars)

Aggregations

IStatusLineManager (org.eclipse.jface.action.IStatusLineManager)68 IToolBarManager (org.eclipse.jface.action.IToolBarManager)33 IActionBars (org.eclipse.ui.IActionBars)33 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)32 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)31 SelectionChangedEvent (org.eclipse.jface.viewers.SelectionChangedEvent)31 AdapterFactoryContentProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryContentProvider)30 AdapterFactoryLabelProvider (org.eclipse.emf.edit.ui.provider.AdapterFactoryLabelProvider)30 IMenuManager (org.eclipse.jface.action.IMenuManager)30 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)30 Composite (org.eclipse.swt.widgets.Composite)30 ContentOutlinePage (org.eclipse.ui.views.contentoutline.ContentOutlinePage)30 IContentOutlinePage (org.eclipse.ui.views.contentoutline.IContentOutlinePage)30 IProgressMonitor (org.eclipse.core.runtime.IProgressMonitor)7 NullProgressMonitor (org.eclipse.core.runtime.NullProgressMonitor)5 ArrayList (java.util.ArrayList)4 IContributionItem (org.eclipse.jface.action.IContributionItem)4 IFile (org.eclipse.core.resources.IFile)3 IAction (org.eclipse.jface.action.IAction)3 StatusLineContributionItem (org.eclipse.jface.action.StatusLineContributionItem)3