org.eclipse.swt.events.MenuDetectListener Java Examples
The following examples show how to use
org.eclipse.swt.events.MenuDetectListener.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ImportWizardPageColumns.java From arx with Apache License 2.0 | 6 votes |
/** * Creates a new editor for the given {@link TableViewer}. * * @param viewer The TableViewer this editor is implemented for * @param columns The columns */ public DatatypeContextMenu(final TableViewer viewer, List<ImportWizardModelColumn> columns) { this.update(columns); this.viewer = viewer; viewer.getTable().addMenuDetectListener(new MenuDetectListener() { @Override public void menuDetected(MenuDetectEvent e) { // Check selection int index = table.getSelectionIndex(); if (index == -1) { return; } // Create and show context menu getMenu(viewer, (ImportWizardModelColumn) table.getItem(index).getData()).setVisible(true); } }); }
Example #2
Source File: AssistField.java From birt with Eclipse Public License 1.0 | 6 votes |
/** * Initialize quick fix menu for content assist. */ protected void initQuickFixMenu( ) { if ( hasQuickFix( ) ) { controlDecoration.addMenuDetectListener( new MenuDetectListener( ) { public void menuDetected( MenuDetectEvent event ) { // no quick fix if we aren't in error state. if ( isValid( ) ) { return; } if ( quickFixMenu == null ) { quickFixMenu = FieldAssistHelper.getInstance( ) .createQuickFixMenu( AssistField.this ); } quickFixMenu.setLocation( event.x, event.y ); quickFixMenu.setVisible( true ); } } ); } }
Example #3
Source File: BreadcrumbViewer.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * A context menu has been requested for the selected breadcrumb item. * * @param event * the event issued the menu detection */ void fireMenuDetect( MenuDetectEvent event ) { Object[] listeners = fMenuListeners.getListeners( ); for ( int i = 0; i < listeners.length; i++ ) { ( (MenuDetectListener) listeners[i] ).menuDetected( event ); } }
Example #4
Source File: BreadcrumbViewer.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 5 votes |
/** * A context menu has been requested for the selected breadcrumb item. * * @param event the event issued the menu detection */ void fireMenuDetect(MenuDetectEvent event) { Object[] listeners= fMenuListeners.getListeners(); for (int i= 0; i < listeners.length; i++) { ((MenuDetectListener)listeners[i]).menuDetected(event); } }
Example #5
Source File: BreadcrumbViewer.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 5 votes |
/** * A context menu has been requested for the selected breadcrumb item. * * @param event the event issued the menu detection */ void fireMenuDetect(MenuDetectEvent event) { Object[] listeners = fMenuListeners.getListeners(); for (int i = 0; i < listeners.length; i++) { ((MenuDetectListener) listeners[i]).menuDetected(event); } }
Example #6
Source File: CalendarCombo.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void removeMenuDetectListener(MenuDetectListener listener) { mComboControl.removeMenuDetectListener(listener); }
Example #7
Source File: ChartComposite.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(SWTEventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); } else if (listener instanceof DragDetectListener) { this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); } else if (listener instanceof MenuDetectListener) { this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); } else if (listener instanceof MouseWheelListener) { this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #8
Source File: ChartComposite.java From astor with GNU General Public License v2.0 | 4 votes |
/** * Hook an SWT listener on the canvas where the chart is drawn. * The purpose of this method is to allow some degree of customization. * * @param listener The SWT listener to attach to the canvas. */ public void addSWTListener(EventListener listener) { if (listener instanceof ControlListener) { this.canvas.addControlListener((ControlListener) listener); } else if (listener instanceof DisposeListener) { this.canvas.addDisposeListener((DisposeListener) listener); } else if (listener instanceof DragDetectListener) { this.canvas.addDragDetectListener((DragDetectListener) listener); } else if (listener instanceof FocusListener) { this.canvas.addFocusListener((FocusListener) listener); } else if (listener instanceof HelpListener) { this.canvas.addHelpListener((HelpListener) listener); } else if (listener instanceof KeyListener) { this.canvas.addKeyListener((KeyListener) listener); } else if (listener instanceof MenuDetectListener) { this.canvas.addMenuDetectListener((MenuDetectListener) listener); } else if (listener instanceof MouseListener) { this.canvas.addMouseListener((MouseListener) listener); } else if (listener instanceof MouseMoveListener) { this.canvas.addMouseMoveListener((MouseMoveListener) listener); } else if (listener instanceof MouseTrackListener) { this.canvas.addMouseTrackListener((MouseTrackListener) listener); } else if (listener instanceof MouseWheelListener) { this.canvas.addMouseWheelListener((MouseWheelListener) listener); } else if (listener instanceof PaintListener) { this.canvas.addPaintListener((PaintListener) listener); } else if (listener instanceof TraverseListener) { this.canvas.addTraverseListener((TraverseListener) listener); } }
Example #9
Source File: Tree.java From ldparteditor with MIT License | 4 votes |
public void addMenuDetectListener(MenuDetectListener mdl) { tree.addMenuDetectListener(mdl); }
Example #10
Source File: CalendarCombo.java From nebula with Eclipse Public License 2.0 | 4 votes |
public void addMenuDetectListener(MenuDetectListener listener) { mComboControl.addMenuDetectListener(listener); }
Example #11
Source File: PasswordRevealer.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Adds the listener to the collection of listeners who will * be notified when the platform-specific context menu trigger * has occurred, by sending it one of the messages defined in * the <code>MenuDetectListener</code> interface. * * @param listener the listener which should be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see MenuDetectListener * @see #removeMenuDetectListener * * @since 3.3 */ @Override public void addMenuDetectListener(final MenuDetectListener listener) { super.addMenuDetectListener(listener); comp.addMenuDetectListener(listener); passwordField.addMenuDetectListener(listener); }
Example #12
Source File: PasswordRevealer.java From nebula with Eclipse Public License 2.0 | 3 votes |
/** * Removes the listener from the collection of listeners who will * be notified when the platform-specific context menu trigger has * occurred. * * @param listener the listener which should no longer be notified * * @exception IllegalArgumentException * <ul> * <li>ERROR_NULL_ARGUMENT - if the listener is null</li> * </ul> * @exception SWTException * <ul> * <li>ERROR_WIDGET_DISPOSED - if the receiver has been disposed</li> * <li>ERROR_THREAD_INVALID_ACCESS - if not called from the thread that created the receiver</li> * </ul> * * @see MenuDetectListener * @see #addMenuDetectListener * * @since 3.3 */ @Override public void removeMenuDetectListener(final MenuDetectListener listener) { super.removeMenuDetectListener(listener); comp.removeMenuDetectListener(listener); passwordField.removeMenuDetectListener(listener); }
Example #13
Source File: BreadcrumbViewer.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 2 votes |
/** * Add the given listener to the set of listeners which will be informed * when a context menu is requested for a breadcrumb item. * * @param listener the listener to add */ public void addMenuDetectListener(MenuDetectListener listener) { fMenuListeners.add(listener); }
Example #14
Source File: BreadcrumbViewer.java From birt with Eclipse Public License 1.0 | 2 votes |
/** * Remove the given listener from the set of menu detect listeners. Does * nothing if the listener is not element of the set. * * @param listener * the listener to remove */ public void removeMenuDetectListener( MenuDetectListener listener ) { fMenuListeners.remove( listener ); }
Example #15
Source File: BreadcrumbViewer.java From birt with Eclipse Public License 1.0 | 2 votes |
/** * Add the given listener to the set of listeners which will be informed * when a context menu is requested for a breadcrumb item. * * @param listener * the listener to add */ public void addMenuDetectListener( MenuDetectListener listener ) { fMenuListeners.add( listener ); }
Example #16
Source File: TimeGraphViewer.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * @param listener * a {@link MenuDetectListener} * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#addTimeGraphEntryMenuListener(org.eclipse.swt.events.MenuDetectListener) */ public void addTimeGraphEntryMenuListener(MenuDetectListener listener) { fTimeGraphCtrl.addTimeGraphEntryMenuListener(listener); }
Example #17
Source File: TimeGraphViewer.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * @param listener * a {@link MenuDetectListener} * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#removeTimeGraphEntryMenuListener(org.eclipse.swt.events.MenuDetectListener) */ public void removeTimeGraphEntryMenuListener(MenuDetectListener listener) { fTimeGraphCtrl.removeTimeGraphEntryMenuListener(listener); }
Example #18
Source File: TimeGraphViewer.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * @param listener * a {@link MenuDetectListener} * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#addTimeEventMenuListener(org.eclipse.swt.events.MenuDetectListener) */ public void addTimeEventMenuListener(MenuDetectListener listener) { fTimeGraphCtrl.addTimeEventMenuListener(listener); }
Example #19
Source File: BreadcrumbViewer.java From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 | 2 votes |
/** * Remove the given listener from the set of menu detect listeners. * Does nothing if the listener is not element of the set. * * @param listener the listener to remove */ public void removeMenuDetectListener(MenuDetectListener listener) { fMenuListeners.remove(listener); }
Example #20
Source File: TimeGraphControl.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * Remove a menu listener on {@link ITimeGraphEntry}s * * @param listener * The listener to remove */ public void removeTimeGraphEntryMenuListener(MenuDetectListener listener) { if (fTimeGraphEntryMenuListeners.contains(listener)) { fTimeGraphEntryMenuListeners.remove(listener); } }
Example #21
Source File: TimeGraphViewer.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * @param listener * a {@link MenuDetectListener} * @see org.eclipse.tracecompass.tmf.ui.widgets.timegraph.widgets.TimeGraphControl#removeTimeEventMenuListener(org.eclipse.swt.events.MenuDetectListener) */ public void removeTimeEventMenuListener(MenuDetectListener listener) { fTimeGraphCtrl.removeTimeEventMenuListener(listener); }
Example #22
Source File: TimeGraphControl.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * Add a menu listener on {@link ITimeGraphEntry}s * * @param listener * The listener to add */ public void addTimeGraphEntryMenuListener(MenuDetectListener listener) { if (!fTimeGraphEntryMenuListeners.contains(listener)) { fTimeGraphEntryMenuListeners.add(listener); } }
Example #23
Source File: BreadcrumbViewer.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 2 votes |
/** * Remove the given listener from the set of menu detect listeners. Does * nothing if the listener is not element of the set. * * @param listener the listener to remove */ public void removeMenuDetectListener(MenuDetectListener listener) { fMenuListeners.remove(listener); }
Example #24
Source File: BreadcrumbViewer.java From gwt-eclipse-plugin with Eclipse Public License 1.0 | 2 votes |
/** * Add the given listener to the set of listeners which will be informed when * a context menu is requested for a breadcrumb item. * * @param listener the listener to add */ public void addMenuDetectListener(MenuDetectListener listener) { fMenuListeners.add(listener); }
Example #25
Source File: TimeGraphControl.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * Menu event callback on {@link ITimeEvent}s * * @param event * The MenuDetectEvent, with field {@link TypedEvent#data} set to the * selected {@link ITimeEvent} */ private void fireMenuEventOnTimeEvent(MenuDetectEvent event) { for (MenuDetectListener listener : fTimeEventMenuListeners) { listener.menuDetected(event); } }
Example #26
Source File: TimeGraphControl.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * Remove a menu listener on {@link ITimeEvent}s * * @param listener * The listener to remove */ public void removeTimeEventMenuListener(MenuDetectListener listener) { if (fTimeEventMenuListeners.contains(listener)) { fTimeEventMenuListeners.remove(listener); } }
Example #27
Source File: TimeGraphControl.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * Add a menu listener on {@link ITimeEvent}s * * @param listener * The listener to add */ public void addTimeEventMenuListener(MenuDetectListener listener) { if (!fTimeEventMenuListeners.contains(listener)) { fTimeEventMenuListeners.add(listener); } }
Example #28
Source File: TimeGraphControl.java From tracecompass with Eclipse Public License 2.0 | 2 votes |
/** * Menu event callback on {@link ITimeGraphEntry}s * * @param event * The MenuDetectEvent, with field {@link TypedEvent#data} set to the * selected {@link ITimeGraphEntry} */ private void fireMenuEventOnTimeGraphEntry(MenuDetectEvent event) { for (MenuDetectListener listener : fTimeGraphEntryMenuListeners) { listener.menuDetected(event); } }