Search in sources :

Example 11 with IMenuListener

use of org.eclipse.jface.action.IMenuListener in project tdi-studio-se by Talend.

the class OperationsTab method createContextMenu.

/**
     * Creates the context menu.
     */
private void createContextMenu() {
    // create actions
    invokeAction = new InvokeAction(tableViewer, section);
    tableViewer.addSelectionChangedListener(invokeAction);
    // create menu manager
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(invokeAction);
        }
    });
    // create context menu
    Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
    tableViewer.getControl().setMenu(menu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 12 with IMenuListener

use of org.eclipse.jface.action.IMenuListener in project tdi-studio-se by Talend.

the class ProcessVersionComposite method addPopUpMenu.

/**
     * DOC Administrator Comment method "addPoppuMenu".
     */
private void addPopUpMenu() {
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopUp");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager mgr) {
            if (getParentWizard() == null) {
                ISelection selection = tableViewer.getSelection();
                if (selection instanceof IStructuredSelection) {
                    IStructuredSelection structuredSelection = (IStructuredSelection) selection;
                    List<ITreeContextualAction> contextualsActions = ActionsHelper.getRepositoryContextualsActions();
                    for (ITreeContextualAction action : contextualsActions) {
                        if (action instanceof OpenExistVersionProcessAction) {
                            continue;
                        }
                        if (action.isReadAction() || action.isEditAction() || action.isPropertiesAction()) {
                            action.init(null, structuredSelection);
                            Object o = structuredSelection.getFirstElement();
                            if (o instanceof RepositoryNode) {
                                ((AContextualAction) action).setAvoidUnloadResources(true);
                            }
                            if (action.isVisible()) {
                                mgr.add(action);
                            }
                        }
                    }
                }
            }
        }
    });
    Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
    tableViewer.getControl().setMenu(menu);
}
Also used : MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) ISelection(org.eclipse.jface.viewers.ISelection) List(java.util.List) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IRepositoryObject(org.talend.core.model.repository.IRepositoryObject) IMenuManager(org.eclipse.jface.action.IMenuManager) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ITreeContextualAction(org.talend.commons.ui.swt.actions.ITreeContextualAction) Menu(org.eclipse.swt.widgets.Menu) RepositoryNode(org.talend.repository.model.RepositoryNode) OpenExistVersionProcessAction(org.talend.designer.core.ui.action.OpenExistVersionProcessAction) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 13 with IMenuListener

use of org.eclipse.jface.action.IMenuListener in project tdi-studio-se by Talend.

the class SWTResourceFilteredTree method createContextMenu.

/**
     * Creates the context menu.
     */
private void createContextMenu() {
    final CopyAction copyAction = CopyAction.createCopyAction(actionBars);
    getViewer().getControl().addFocusListener(new FocusListener() {

        @Override
        public void focusLost(FocusEvent e) {
            getViewer().removeSelectionChangedListener(copyAction);
        }

        @Override
        public void focusGained(FocusEvent e) {
            getViewer().addSelectionChangedListener(copyAction);
        }
    });
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopupMenu");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        @Override
        public void menuAboutToShow(IMenuManager manager) {
            manager.add(copyAction);
        }
    });
    Menu menu = menuMgr.createContextMenu(getViewer().getControl());
    getViewer().getControl().setMenu(menu);
}
Also used : CopyAction(org.talend.designer.runtime.visualization.internal.actions.CopyAction) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu) FocusListener(org.eclipse.swt.events.FocusListener) FocusEvent(org.eclipse.swt.events.FocusEvent) IMenuListener(org.eclipse.jface.action.IMenuListener)

Example 14 with IMenuListener

use of org.eclipse.jface.action.IMenuListener in project tdi-studio-se by Talend.

the class VersionSection method createControls.

@Override
public void createControls(Composite parent, TabbedPropertySheetPage aTabbedPropertySheetPage) {
    super.createControls(parent, aTabbedPropertySheetPage);
    composite = getWidgetFactory().createFlatFormComposite(parent);
    tableViewer = new TableViewer(composite, SWT.BORDER | SWT.MULTI | SWT.FULL_SELECTION);
    final Table table = tableViewer.getTable();
    TableLayout tableLayout = new TableLayout();
    table.setLayout(tableLayout);
    table.setHeaderVisible(true);
    table.setLinesVisible(true);
    final String[] columnProperties = new String[] { //$NON-NLS-1$
    Messages.getString("VersionSection.Version"), //$NON-NLS-1$
    Messages.getString("VersionSection.CreationDate"), Messages.getString("VersionSection.ModificationDate"), //$NON-NLS-1$ //$NON-NLS-2$ 
    Messages.getString("VersionSection.Status") };
    final TableColumn column1 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnPixelData(125, true));
    column1.setText(columnProperties[0]);
    final TableColumn column2 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnPixelData(125, true));
    column2.setText(columnProperties[1]);
    final TableColumn column3 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnPixelData(125, true));
    column3.setText(columnProperties[2]);
    final TableColumn column4 = new TableColumn(table, SWT.NONE);
    tableLayout.addColumnData(new ColumnWeightData(1, 150, true));
    column4.setText(columnProperties[3]);
    tableViewer.setColumnProperties(columnProperties);
    Object layoutData = parent.getLayoutData();
    if (layoutData instanceof GridData) {
        GridData gridData = (GridData) layoutData;
        gridData.grabExcessVerticalSpace = true;
        gridData.verticalAlignment = SWT.FILL;
    }
    FormData formData = new FormData();
    formData.left = new FormAttachment(0);
    formData.top = new FormAttachment(0);
    formData.right = new FormAttachment(100);
    formData.bottom = new FormAttachment(100);
    table.setLayoutData(formData);
    tableViewer.setContentProvider(new IStructuredContentProvider() {

        public Object[] getElements(Object inputElement) {
            IRepositoryViewObject repositoryObject = ((IRepositoryViewObject) inputElement);
            if (repositoryObject.getProperty() == null) {
                return null;
            }
            RepositoryNode parentRepositoryNode = RepositoryNodeUtilities.getParentRepositoryNodeFromSelection(repositoryObject);
            try {
                List<IRepositoryViewObject> allVersion = ProxyRepositoryFactory.getInstance().getAllVersion(repositoryObject.getId());
                Collections.sort(allVersion, new IRepositoryObjectComparator());
                Object[] objects = new Object[allVersion.size()];
                for (int i = 0; i < objects.length; i++) {
                    IRepositoryViewObject repositoryObjectVersion = allVersion.get(i);
                    RepositoryNode repositoryNode = createRepositoryNode(parentRepositoryNode, repositoryObjectVersion);
                    objects[i] = repositoryNode;
                }
                return objects;
            } catch (PersistenceException e) {
                return null;
            }
        }

        private RepositoryNode createRepositoryNode(RepositoryNode parentRepositoryNode, IRepositoryViewObject repositoryObjectVersion) {
            ERepositoryObjectType itemType = ERepositoryObjectType.getItemType(repositoryObjectVersion.getProperty().getItem());
            RepositoryNode repositoryNode = new RepositoryNode(repositoryObjectVersion, parentRepositoryNode, ENodeType.REPOSITORY_ELEMENT);
            repositoryNode.setProperties(EProperties.CONTENT_TYPE, itemType);
            repositoryNode.setProperties(EProperties.LABEL, repositoryObjectVersion.getLabel());
            return repositoryNode;
        }

        public void dispose() {
        }

        public void inputChanged(Viewer viewer, Object oldInput, Object newInput) {
        }
    });
    tableViewer.setLabelProvider(new ITableLabelProvider() {

        public Image getColumnImage(Object element, int columnIndex) {
            return null;
        }

        public String getColumnText(Object element, int columnIndex) {
            RepositoryNode repositoryNode = (RepositoryNode) element;
            switch(columnIndex) {
                case 0:
                    return repositoryNode.getObject().getVersion();
                case 1:
                    if (repositoryNode.getObject().getCreationDate() != null) {
                        return FORMATTER.format(repositoryNode.getObject().getCreationDate());
                    } else {
                        return null;
                    }
                case 2:
                    if (repositoryNode.getObject().getModificationDate() != null) {
                        return FORMATTER.format(repositoryNode.getObject().getModificationDate());
                    } else {
                        return null;
                    }
                case 3:
                    if (repositoryNode.getObject().getStatusCode() != null) {
                        return repositoryNode.getObject().getStatusCode();
                    } else {
                        return null;
                    }
                default:
                    return null;
            }
        }

        public void addListener(ILabelProviderListener listener) {
        }

        public void dispose() {
        }

        public boolean isLabelProperty(Object element, String property) {
            return false;
        }

        public void removeListener(ILabelProviderListener listener) {
        }
    });
    //$NON-NLS-1$
    MenuManager menuMgr = new MenuManager("#PopUp");
    menuMgr.setRemoveAllWhenShown(true);
    menuMgr.addMenuListener(new IMenuListener() {

        public void menuAboutToShow(IMenuManager mgr) {
            ISelection selection = tableViewer.getSelection();
            if (selection instanceof IStructuredSelection) {
                IStructuredSelection structuredSelection = (IStructuredSelection) selection;
                List<ITreeContextualAction> contextualsActions = ActionsHelper.getRepositoryContextualsActions();
                for (ITreeContextualAction action : contextualsActions) {
                    if (action.isReadAction() || action.isEditAction() || action.isPropertiesAction()) {
                        action.init(null, structuredSelection);
                        if (action.isVisible()) {
                            mgr.add(action);
                        }
                    }
                }
            }
        }
    });
    Menu menu = menuMgr.createContextMenu(tableViewer.getControl());
    tableViewer.getControl().setMenu(menu);
    Listener sortListener = new Listener() {

        private int direction = 1;

        public void handleEvent(Event e) {
            final TableColumn column = (TableColumn) e.widget;
            if (column == table.getSortColumn()) {
                direction = -direction;
            }
            if (direction == 1) {
                table.setSortDirection(SWT.DOWN);
            } else {
                table.setSortDirection(SWT.UP);
            }
            table.setSortColumn(column);
            tableViewer.setSorter(new ViewerSorter() {

                int index = 0;

                @Override
                public void sort(Viewer viewer, Object[] elements) {
                    while (index < table.getColumns().length && table.getColumn(index) != column) {
                        index++;
                    }
                    super.sort(viewer, elements);
                }

                @Override
                public int compare(Viewer viewer, Object e1, Object e2) {
                    ITableLabelProvider labelProvider = (ITableLabelProvider) tableViewer.getLabelProvider();
                    String columnText = labelProvider.getColumnText(e1, index) != null ? labelProvider.getColumnText(e1, index) : //$NON-NLS-1$
                    "";
                    String columnText2 = labelProvider.getColumnText(e2, index) != null ? labelProvider.getColumnText(e2, index) : //$NON-NLS-1$
                    "";
                    return getComparator().compare(columnText, columnText2) * direction;
                }
            });
        }
    };
    column1.addListener(SWT.Selection, sortListener);
    column2.addListener(SWT.Selection, sortListener);
    column3.addListener(SWT.Selection, sortListener);
    column4.addListener(SWT.Selection, sortListener);
    table.setSortColumn(column1);
    table.setSortDirection(SWT.DOWN);
    aTabbedPropertySheetPage.getSite().setSelectionProvider(this);
}
Also used : ColumnWeightData(org.eclipse.jface.viewers.ColumnWeightData) ISelectionChangedListener(org.eclipse.jface.viewers.ISelectionChangedListener) Listener(org.eclipse.swt.widgets.Listener) ILabelProviderListener(org.eclipse.jface.viewers.ILabelProviderListener) IMenuListener(org.eclipse.jface.action.IMenuListener) ViewerSorter(org.eclipse.jface.viewers.ViewerSorter) TableViewer(org.eclipse.jface.viewers.TableViewer) Viewer(org.eclipse.jface.viewers.Viewer) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) ITreeContextualAction(org.talend.commons.ui.swt.actions.ITreeContextualAction) Image(org.eclipse.swt.graphics.Image) ITableLabelProvider(org.eclipse.jface.viewers.ITableLabelProvider) ISelection(org.eclipse.jface.viewers.ISelection) List(java.util.List) Menu(org.eclipse.swt.widgets.Menu) ERepositoryObjectType(org.talend.core.model.repository.ERepositoryObjectType) TableLayout(org.eclipse.jface.viewers.TableLayout) FormAttachment(org.eclipse.swt.layout.FormAttachment) FormData(org.eclipse.swt.layout.FormData) Table(org.eclipse.swt.widgets.Table) ColumnPixelData(org.eclipse.jface.viewers.ColumnPixelData) RepositoryNode(org.talend.repository.model.RepositoryNode) TableColumn(org.eclipse.swt.widgets.TableColumn) IMenuListener(org.eclipse.jface.action.IMenuListener) ILabelProviderListener(org.eclipse.jface.viewers.ILabelProviderListener) GridData(org.eclipse.swt.layout.GridData) IStructuredContentProvider(org.eclipse.jface.viewers.IStructuredContentProvider) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) PersistenceException(org.talend.commons.exception.PersistenceException) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) Event(org.eclipse.swt.widgets.Event) IRepositoryObject(org.talend.core.model.repository.IRepositoryObject) IRepositoryViewObject(org.talend.core.model.repository.IRepositoryViewObject) IMenuManager(org.eclipse.jface.action.IMenuManager) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 15 with IMenuListener

use of org.eclipse.jface.action.IMenuListener in project cubrid-manager by CUBRID.

the class LogEditorPart method createPartControl.

/**
	 * @see org.eclipse.ui.part.WorkbenchPart#createPartControl(org.eclipse.swt.widgets.Composite)
	 * @param parent the parent control
	 * @see IWorkbenchPart
	 */
public void createPartControl(Composite parent) {
    final Composite compositeLog = new Composite(parent, SWT.NONE);
    {
        GridLayout gridLayoutLog = new GridLayout();
        gridLayoutLog.verticalSpacing = 0;
        gridLayoutLog.marginWidth = 0;
        gridLayoutLog.marginHeight = 0;
        gridLayoutLog.horizontalSpacing = 5;
        gridLayoutLog.numColumns = 8;
        compositeLog.setLayout(gridLayoutLog);
    }
    final String type = this.cubridNode.getType();
    table = new Table(compositeLog, SWT.MULTI | SWT.FULL_SELECTION | SWT.BORDER);
    {
        table.setHeaderVisible(true);
        GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true);
        gridData.horizontalSpan = 8;
        gridData.verticalSpan = 10;
        gridData.heightHint = 600;
        table.setLayoutData(gridData);
        table.setLinesVisible(true);
    }
    // fill in context menu
    if (CubridNodeType.BROKER_SQL_LOG.equals(type) || CubridNodeType.LOGS_BROKER_ERROR_LOG.equals(type) || CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(type) || CubridNodeType.LOGS_SERVER_DATABASE_LOG.equals(type) || CubridNodeType.LOGS_APPLY_DATABASE_LOG.equals(type) || CubridNodeType.LOGS_COPY_DATABASE_LOG.equals(type)) {
        //Create the context menu
        MenuManager contextMenuManager = new MenuManager();
        contextMenuManager.setRemoveAllWhenShown(true);
        contextMenuManager.addMenuListener(new IMenuListener() {

            public void menuAboutToShow(IMenuManager manager) {
                buildPopupMenu(manager, type);
            }
        });
        Menu contextMenu = contextMenuManager.createContextMenu(table);
        table.setMenu(contextMenu);
        //Add listener
        table.addKeyListener(new KeyAdapter() {

            public void keyPressed(KeyEvent event) {
                if ((event.stateMask & SWT.CTRL) != 0 && (event.stateMask & SWT.SHIFT) == 0 && event.keyCode == 'c') {
                    copyDataToClipboard(type);
                }
            }
        });
    }
    table.addListener(SWT.MouseDoubleClick, new Listener() {

        public void handleEvent(Event event) {
            if (CubridNodeType.BROKER_SQL_LOG.equals(cubridNode.getType())) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length == 1) {
                    final String content = items[0].getText(1);
                    new LogContentDetailDialog(getSite().getShell(), content).open();
                }
            } else if (CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(cubridNode.getType())) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length == 1) {
                    final String content = items[0].getText(4);
                    new LogContentDetailDialog(getSite().getShell(), content).open();
                }
            } else if (CubridNodeType.LOGS_BROKER_ERROR_LOG.equals(cubridNode.getType())) {
                TableItem[] items = table.getSelection();
                if (items != null && items.length == 1) {
                    final String content = items[0].getText(6);
                    new LogContentDetailDialog(getSite().getShell(), content).open();
                }
            }
        }
    });
    // add bottom composite for page
    Label labelCharset = new Label(compositeLog, SWT.NONE);
    {
        labelCharset.setText(Messages.labelCharset);
        charsetCombo = new Combo(compositeLog, SWT.BORDER);
        final GridData gdCharsetText = CommonUITool.createGridData(1, 1, -1, -1);
        charsetCombo.setLayoutData(gdCharsetText);
        charsetCombo.setItems(QueryOptions.getAllCharset(null));
        charsetCombo.setText(charsetName);
    }
    Button viewLogBtn = new Button(compositeLog, SWT.NONE);
    {
        viewLogBtn.setText(Messages.viewLogJobName);
        viewLogBtn.setLayoutData(CommonUITool.createGridData(1, 1, 100, -1));
        viewLogBtn.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                String charsetName = charsetCombo.getText();
                try {
                    "".getBytes(charsetName);
                } catch (UnsupportedEncodingException e) {
                    CommonUITool.openErrorBox(Messages.errCharset);
                    charsetCombo.setFocus();
                    return;
                }
                setCharsetName(charsetName);
                if (!CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(type) && !CubridNodeType.LOGS_MANAGER_ACCESS_LOG.equals(type)) {
                    connect(false);
                }
                if (CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(type) || CubridNodeType.LOGS_MANAGER_ACCESS_LOG.equals(type)) {
                    managerConnect();
                    updateManagerLogTable();
                }
            }
        });
    }
    // page button
    if (!CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(type) && !CubridNodeType.LOGS_MANAGER_ACCESS_LOG.equals(type)) {
        pageText = new Text(compositeLog, SWT.BORDER);
        {
            pageText.setVisible(true);
            pageText.setEditable(false);
            GridData gridData = createPageBtnGridData(150);
            gridData.grabExcessHorizontalSpace = true;
            pageText.setLayoutData(gridData);
        }
        buttonFirst = new Button(compositeLog, SWT.NONE);
        {
            buttonFirst.setVisible(true);
            buttonFirst.setText("|<");
            buttonFirst.setLayoutData(createPageBtnGridData(60));
            buttonFirst.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent event) {
                    lineStart = 1;
                    lineEnd = 100;
                    connect(false);
                }
            });
        }
        buttonPrev = new Button(compositeLog, SWT.NONE);
        {
            buttonPrev.setVisible(true);
            buttonPrev.setText("<");
            buttonPrev.setLayoutData(createPageBtnGridData(60));
            buttonPrev.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent event) {
                    lineStart -= 100;
                    if (lineStart < 1) {
                        lineStart = 1;
                    }
                    lineEnd = lineStart + 99;
                    connect(false);
                }
            });
        }
        buttonNext = new Button(compositeLog, SWT.NONE);
        {
            buttonNext.setVisible(true);
            buttonNext.setText(">");
            buttonNext.setLayoutData(createPageBtnGridData(60));
            buttonNext.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent event) {
                    lineStart += 100;
                    if (lineStart > lineTot) {
                        lineStart = lineTot;
                    }
                    lineEnd = lineStart + 99;
                    if (lineEnd > lineTot) {
                        lineEnd = lineTot;
                    }
                    connect(false);
                }
            });
        }
        buttonEnd = new Button(compositeLog, SWT.NONE);
        {
            buttonEnd.setVisible(true);
            buttonEnd.setText(">|");
            buttonEnd.setLayoutData(createPageBtnGridData(60));
            buttonEnd.addSelectionListener(new SelectionAdapter() {

                public void widgetSelected(SelectionEvent event) {
                    lineEnd = lineTot;
                    lineStart = lineEnd - lineTot % 100 + 1;
                    connect(false);
                }
            });
        }
    }
    // manager log page button
    if (CubridNodeType.LOGS_MANAGER_ERROR_LOG.equals(type) || CubridNodeType.LOGS_MANAGER_ACCESS_LOG.equals(type)) {
        pageText = new Text(compositeLog, SWT.BORDER);
        {
            pageText.setVisible(true);
            pageText.setEditable(false);
            GridData gridData = createPageBtnGridData(150);
            gridData.grabExcessHorizontalSpace = true;
            pageText.setLayoutData(gridData);
        }
        buttonFirst = new Button(compositeLog, SWT.NONE);
        buttonFirst.setVisible(true);
        buttonFirst.setText("|<");
        buttonFirst.setLayoutData(createPageBtnGridData(60));
        buttonFirst.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                pageInfo.setCurrentPage(1);
                updateManagerLogTable();
            }
        });
        buttonPrev = new Button(compositeLog, SWT.NONE);
        buttonPrev.setVisible(true);
        buttonPrev.setText("<");
        buttonPrev.setLayoutData(createPageBtnGridData(60));
        buttonPrev.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                pageInfo.setCurrentPage(pageInfo.getCurrentPage() - 1);
                updateManagerLogTable();
            }
        });
        buttonNext = new Button(compositeLog, SWT.NONE);
        buttonNext.setVisible(true);
        buttonNext.setText(">");
        buttonNext.setLayoutData(createPageBtnGridData(60));
        buttonNext.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                pageInfo.setCurrentPage(pageInfo.getCurrentPage() + 1);
                updateManagerLogTable();
            }
        });
        buttonEnd = new Button(compositeLog, SWT.NONE);
        buttonEnd.setVisible(true);
        buttonEnd.setText(">|");
        buttonEnd.setLayoutData(createPageBtnGridData(60));
        buttonEnd.addSelectionListener(new SelectionAdapter() {

            public void widgetSelected(SelectionEvent event) {
                pageInfo.setCurrentPage(pageInfo.getPages());
                updateManagerLogTable();
            }
        });
    }
    compositeLog.pack();
}
Also used : Table(org.eclipse.swt.widgets.Table) IMenuListener(org.eclipse.jface.action.IMenuListener) Listener(org.eclipse.swt.widgets.Listener) Composite(org.eclipse.swt.widgets.Composite) KeyAdapter(org.eclipse.swt.events.KeyAdapter) LogContentDetailDialog(com.cubrid.cubridmanager.ui.logs.dialog.LogContentDetailDialog) TableItem(org.eclipse.swt.widgets.TableItem) SelectionAdapter(org.eclipse.swt.events.SelectionAdapter) Label(org.eclipse.swt.widgets.Label) UnsupportedEncodingException(java.io.UnsupportedEncodingException) Combo(org.eclipse.swt.widgets.Combo) Text(org.eclipse.swt.widgets.Text) IMenuListener(org.eclipse.jface.action.IMenuListener) KeyEvent(org.eclipse.swt.events.KeyEvent) GridLayout(org.eclipse.swt.layout.GridLayout) Button(org.eclipse.swt.widgets.Button) GridData(org.eclipse.swt.layout.GridData) MenuManager(org.eclipse.jface.action.MenuManager) IMenuManager(org.eclipse.jface.action.IMenuManager) SelectionEvent(org.eclipse.swt.events.SelectionEvent) KeyEvent(org.eclipse.swt.events.KeyEvent) CubridNodeChangedEvent(com.cubrid.common.ui.spi.event.CubridNodeChangedEvent) Event(org.eclipse.swt.widgets.Event) SelectionEvent(org.eclipse.swt.events.SelectionEvent) IMenuManager(org.eclipse.jface.action.IMenuManager) Menu(org.eclipse.swt.widgets.Menu)

Aggregations

IMenuListener (org.eclipse.jface.action.IMenuListener)48 IMenuManager (org.eclipse.jface.action.IMenuManager)48 MenuManager (org.eclipse.jface.action.MenuManager)47 Menu (org.eclipse.swt.widgets.Menu)43 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)12 Separator (org.eclipse.jface.action.Separator)9 GridData (org.eclipse.swt.layout.GridData)8 Action (org.eclipse.jface.action.Action)6 GridLayout (org.eclipse.swt.layout.GridLayout)6 IAction (org.eclipse.jface.action.IAction)5 TreeViewer (org.eclipse.jface.viewers.TreeViewer)5 FocusEvent (org.eclipse.swt.events.FocusEvent)5 Composite (org.eclipse.swt.widgets.Composite)5 List (java.util.List)4 ISelectionChangedListener (org.eclipse.jface.viewers.ISelectionChangedListener)4 TreeColumn (org.eclipse.swt.widgets.TreeColumn)4 TableViewer (org.eclipse.jface.viewers.TableViewer)3 ITreeContextualAction (org.talend.commons.ui.swt.actions.ITreeContextualAction)3 ConfigureColumnsAction (org.talend.designer.runtime.visualization.internal.actions.ConfigureColumnsAction)3 CopyAction (org.talend.designer.runtime.visualization.internal.actions.CopyAction)3