Package org.eclipse.ui.internal.presentations

Examples of org.eclipse.ui.internal.presentations.BasicPartList$BasicStackListLabelProvider


    public void show(Control control, Point displayCoordinates,
            IPresentablePart currentSelection) {

        int shellStyle = SWT.RESIZE | SWT.ON_TOP | SWT.NO_TRIM;
        int tableStyle = SWT.V_SCROLL | SWT.H_SCROLL;
        final BasicPartList editorList = new BasicPartList(control.getShell(),
                shellStyle, tableStyle, site, folder);
        editorList.setInput(folder);
        Point size = editorList.computeSizeHint();
        int x = displayCoordinates.x;
        int y = displayCoordinates.y;

        Monitor mon = folder.getTabFolder().getControl().getMonitor();
        Rectangle bounds = mon.getClientArea();
        if (x + size.x > bounds.x + bounds.width) {
      x = bounds.x + bounds.width - size.x;
    }
        if (y + size.y > bounds.y + bounds.height) {
      y = bounds.y + bounds.height - size.y;
    }
        editorList.setLocation(new Point(x, y));
        editorList.setVisible(true);
        editorList.setFocus();
        editorList.getTableViewer().getTable().getShell().addListener(
                SWT.Deactivate, new Listener() {

                    public void handleEvent(Event event) {
                        editorList.setVisible(false);
                    }
                }
          );
    }
View Full Code Here

TOP

Related Classes of org.eclipse.ui.internal.presentations.BasicPartList$BasicStackListLabelProvider

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.