Package org.eclipse.jface.viewers

Examples of org.eclipse.jface.viewers.ISelection


    /* Only if Table Viewer is visible */
    if (isTableViewerVisible()) {
      boolean groupingEnabled = fNewsGrouping.getType() != NewsGrouping.Type.NO_GROUPING;

      /* Remember Selection if grouping enabled */
      ISelection selection = StructuredSelection.EMPTY;
      if (groupingEnabled)
        selection = fNewsTableControl.getViewer().getSelection();

      /* Delay redraw operations if requested */
      if (delayRedraw)
View Full Code Here


    };

    /* Retrieve and select new Target Node */
    ITreeNode targetNode = (next ? traverse.nextNode() : traverse.previousNode());
    if (targetNode != null) {
      ISelection selection = new StructuredSelection(targetNode.getData());
      fNewsTableControl.getViewer().setSelection(selection, true);
      return true;
    }

    return false;
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.swt.dnd.DragSourceListener#dragStart(org.eclipse.swt.dnd.DragSourceEvent)
     */
    public void dragStart(DragSourceEvent event) {
        ISelection selection = viewer.getSelection();
        Object node = SelectionUtil.getSingleElement(viewer.getSelection());
        if (!(node instanceof AspectNode))
            event.doit = false;
        else
            LocalSelectionTransfer.getInstance().setSelection(selection);
View Full Code Here

    /* (non-Javadoc)
     * @see org.eclipse.debug.ui.contexts.IDebugContextListener#debugContextChanged(org.eclipse.debug.ui.contexts.DebugContextEvent)
     */
    public void debugContextChanged(DebugContextEvent event) {
        ISelection selection = event.getContext();
        if(selection instanceof IStructuredSelection){
            IStructuredSelection sSelection = (IStructuredSelection) selection;
            if(sSelection.isEmpty()){
                return;
            }
View Full Code Here

            setAccelerator(SWT.CTRL | SWT.SHIFT | 'B');
        }

        public void run() {
            if (editor != null) {
                ISelection selection = editor.getSelectionProvider()
                    .getSelection();
                boolean showBytecode = isChecked();
                if (editor.isDecompiled() != showBytecode) {

                    editor.doSetInput(true, !showBytecode);
View Full Code Here

        public void run() {
            if (editor != null) {
                editor.setDecompilerFlag(
                    BCOConstants.F_SHOW_RAW_BYTECODE, isChecked());
                ISelection selection = editor.getSelectionProvider()
                    .getSelection();

                // we convert selection first to source line bacause bytecode lines could
                // not match for different bytecode view modes.
                int sourceLine = 0;
View Full Code Here

                        .getSelectionService();
                    try {
                        IViewPart part = workbenchWindow.getActivePage()
                            .showView(
                                "de.loskutov.bco.views.BytecodeOutlineView");
                        ISelection selection = selectionService
                            .getSelection("de.loskutov.bco.views.BytecodeOutlineView");
                        selectionChanged(part, selection);
                    } catch (PartInitException e) {
                        BytecodeOutlinePlugin.log(e, IStatus.ERROR);
                    }
View Full Code Here

            String partId = BytecodeOutlineView.class.getName();
            selectionService.addPostSelectionListener(this);


            // perform initialization with already existing selection (if any)
            ISelection selection = selectionService.getSelection(partId);
            if(selection != null) {
                IViewReference viewReference = workbenchWindow.getActivePage()
                    .findViewReference(partId);
                if(viewReference != null) {
                    selectionChanged(viewReference.getView(false), selection);
View Full Code Here

     * @param selectionProvider
     * @return TextSelection or null, if provider does not provide TextSelection's
     */
    public static ITextSelection getSelection(
        ISelectionProvider selectionProvider) {
        ISelection selection = selectionProvider.getSelection();
        if (selection instanceof ITextSelection) {
            return (ITextSelection) selection;
        }
        return null;
    }
View Full Code Here

        Object current = getViewer().getInput();
       
        // if the debug view stack still contains the same WorkingMemoryImpl, do nothing
        if (current != null) {
            ISelection stackSelection = getSite().getPage().getSelection(IDebugUIConstants.ID_DEBUG_VIEW);
            if (stackSelection instanceof IStructuredSelection) {
                Object stack = ((IStructuredSelection) stackSelection).getFirstElement();
                if (stack instanceof IJavaStackFrame) {
                    try {
                        IJavaObject stackObj = ((IJavaStackFrame) stack).getThis();
View Full Code Here

TOP

Related Classes of org.eclipse.jface.viewers.ISelection

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.