Java Code Examples for org.eclipse.swt.widgets.Display#removeFilter()
The following examples show how to use
org.eclipse.swt.widgets.Display#removeFilter() .
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: MultiChoice.java From nebula with Eclipse Public License 2.0 | 6 votes |
/** * Handle a multichoice event * * @param event event to handle */ private void handleMultiChoiceEvents(final Event event) { switch (event.type) { case SWT.Dispose: if (this.popup != null && !this.popup.isDisposed()) { this.popup.dispose(); } final Shell shell = getShell(); shell.removeListener(SWT.Deactivate, this.listener); final Display display = getDisplay(); display.removeFilter(SWT.FocusIn, this.filter); this.popup = null; this.arrow = null; break; case SWT.Move: changeVisibilityOfPopupWindow(false); break; case SWT.Resize: if (isDropped()) { changeVisibilityOfPopupWindow(false); } break; } }
Example 2
Source File: CalculatorCombo.java From nebula with Eclipse Public License 2.0 | 6 votes |
private void handleMultiChoiceEvent(final Event event) { switch (event.type) { case SWT.Dispose: if (popup != null && !popup.isDisposed()) { popup.dispose(); } final Shell shell = getShell(); shell.removeListener(SWT.Deactivate, listener); final Display display = getDisplay(); display.removeFilter(SWT.FocusIn, filter); popup = null; arrow = null; break; case SWT.Move: hidePopupWindow(false); break; case SWT.Resize: if (isPopupVisible()) { hidePopupWindow(false); } break; } }
Example 3
Source File: CustomCombo.java From nebula with Eclipse Public License 2.0 | 5 votes |
void comboEvent(Event event) { switch (event.type) { case SWT.Dispose: if (popup != null && !popup.isDisposed()) { list.removeListener(SWT.Dispose, listener); popup.dispose(); } Shell shell = getShell(); shell.removeListener(SWT.Deactivate, listener); Display display = getDisplay(); display.removeFilter(SWT.FocusIn, filter); popup = null; text = null; list = null; arrow = null; break; case SWT.FocusIn: Control focusControl = getDisplay().getFocusControl(); if (focusControl == arrow || focusControl == list) return; if (isDropped()) { list.setFocus(); } else { text.setFocus(); } break; case SWT.Move: dropDown(false); break; case SWT.Resize: internalLayout(false); break; } }
Example 4
Source File: DateChooser.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Handles the focus. * * @param mode SWT.FocusIn or SWT.FocusOut */ private void handleFocus(int mode) { switch (mode) { case SWT.FocusIn: { if (hasFocus) { return; } hasFocus = true; final Display display = getDisplay(); display.removeFilter(SWT.KeyDown, filter); display.removeFilter(SWT.FocusIn, filter); if (focusIndex < 0) { setFocus(NOFOCUS); } notifyListeners(SWT.FocusIn, new Event()); display.addFilter(SWT.FocusIn, filter); display.addFilter(SWT.KeyDown, filter); break; } case SWT.FocusOut: { if (!hasFocus) { return; } final Control focusControl = getDisplay().getFocusControl(); if (focusControl == DateChooser.this || focusControl == nextMonth || focusControl == prevMonth) { return; } hasFocus = false; getDisplay().removeFilter(SWT.KeyDown, filter); getDisplay().removeFilter(SWT.FocusIn, filter); notifyListeners(SWT.FocusOut, new Event()); break; } } gridRedraw(); }
Example 5
Source File: FormattedText.java From nebula with Eclipse Public License 2.0 | 5 votes |
/** * Sets the Text widget value, preventing fire of Modify events. * * @param value The String value to display in the widget */ private void setText(String value) { Display display = text.getDisplay(); try { display.addFilter(SWT.Modify, modifyFilter); text.setText(value); } finally { display.removeFilter(SWT.Modify, modifyFilter); } }
Example 6
Source File: CTreeCombo.java From nebula with Eclipse Public License 2.0 | 5 votes |
void comboEvent(Event event) { switch (event.type) { case SWT.Dispose: if (popup != null && !popup.isDisposed()) { tree.removeListener(SWT.Dispose, listener); popup.dispose(); } final Shell shell = getShell(); shell.removeListener(SWT.Deactivate, listener); final Display display = getDisplay(); display.removeFilter(SWT.FocusIn, filter); popup = null; text = null; tree = null; arrow = null; break; case SWT.FocusIn: final Control focusControl = getDisplay().getFocusControl(); if (focusControl == arrow || focusControl == tree) { return; } if (isDropped()) { tree.setFocus(); } else { text.setFocus(); } break; case SWT.Move: dropDown(false); break; case SWT.Resize: internalLayout(false); break; } }
Example 7
Source File: GLScene.java From depan with Apache License 2.0 | 5 votes |
protected void dispose() { if (canvas != null) { Display display = canvas.getDisplay(); display.removeFilter(SWT.MouseVerticalWheel, wheelListener); display.removeFilter(SWT.MouseHorizontalWheel, wheelListener); canvas.dispose(); canvas = null; } }
Example 8
Source File: TableCombo.java From translationstudio8 with GNU General Public License v2.0 | 5 votes |
/** * Handle Combo events * @param event */ private void comboEvent(Event event) { switch (event.type) { case SWT.Dispose: removeListener(SWT.Dispose, listener); notifyListeners(SWT.Dispose, event); event.type = SWT.None; if (popup != null && !popup.isDisposed()) { table.removeListener(SWT.Dispose, listener); popup.dispose(); } Shell shell = getShell(); shell.removeListener(SWT.Deactivate, listener); Display display = getDisplay(); display.removeFilter(SWT.FocusIn, focusFilter); popup = null; text = null; table = null; arrow = null; selectedImage = null; break; case SWT.FocusIn: Control focusControl = getDisplay().getFocusControl(); if (focusControl == arrow || focusControl == table) return; if (isDropped()) { table.setFocus(); } else { text.setFocus(); } break; case SWT.Move: dropDown(false); break; case SWT.Resize: internalLayout(false); break; } }
Example 9
Source File: TableCombo.java From tmxeditor8 with GNU General Public License v2.0 | 5 votes |
/** * Handle Combo events * @param event */ private void comboEvent(Event event) { switch (event.type) { case SWT.Dispose: removeListener(SWT.Dispose, listener); notifyListeners(SWT.Dispose, event); event.type = SWT.None; if (popup != null && !popup.isDisposed()) { table.removeListener(SWT.Dispose, listener); popup.dispose(); } Shell shell = getShell(); shell.removeListener(SWT.Deactivate, listener); Display display = getDisplay(); display.removeFilter(SWT.FocusIn, focusFilter); popup = null; text = null; table = null; arrow = null; selectedImage = null; break; case SWT.FocusIn: Control focusControl = getDisplay().getFocusControl(); if (focusControl == arrow || focusControl == table) return; if (isDropped()) { table.setFocus(); } else { text.setFocus(); } break; case SWT.Move: dropDown(false); break; case SWT.Resize: internalLayout(false); break; } }
Example 10
Source File: TableCombo.java From Pydev with Eclipse Public License 1.0 | 5 votes |
/** * Handle Combo events * @param event */ private void comboEvent(Event event) { switch (event.type) { case SWT.Dispose: removeListener(SWT.Dispose, listener); notifyListeners(SWT.Dispose, event); event.type = SWT.None; if (popup != null && !popup.isDisposed()) { table.removeListener(SWT.Dispose, listener); popup.dispose(); } Shell shell = getShell(); shell.removeListener(SWT.Deactivate, listener); Display display = getDisplay(); display.removeFilter(SWT.FocusIn, focusFilter); popup = null; text = null; table = null; arrow = null; selectedImage = null; break; case SWT.FocusIn: Control focusControl = getDisplay().getFocusControl(); if (focusControl == arrow || focusControl == table) return; if (isDropped()) { table.setFocus(); } else { text.setFocus(); } break; case SWT.Move: dropDown(false); break; case SWT.Resize: internalLayout(false); break; } }
Example 11
Source File: DateChooser.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * Manages event at the calendar level. * * @param event event */ protected void calendarEvent(Event event) { switch (event.type) { case SWT.Traverse: switch (event.detail) { case SWT.TRAVERSE_ARROW_NEXT: case SWT.TRAVERSE_ARROW_PREVIOUS: case SWT.TRAVERSE_PAGE_NEXT: case SWT.TRAVERSE_PAGE_PREVIOUS: event.doit = false; break; default: event.doit = true; } break; case SWT.FocusIn: handleFocus(event.type); break; case SWT.KeyDown: { final boolean ctrl = (event.stateMask & SWT.CTRL) != 0; switch (event.keyCode) { case SWT.ARROW_LEFT: if (event.stateMask != 0) { return; } setFocus(focusIndex - 1); break; case SWT.ARROW_RIGHT: if (event.stateMask != 0) { return; } setFocus(focusIndex + 1); break; case SWT.ARROW_UP: if (event.stateMask != 0) { return; } setFocus(focusIndex - 7); break; case SWT.ARROW_DOWN: if (event.stateMask != 0) { return; } setFocus(focusIndex + 7); break; case SWT.PAGE_DOWN: if (event.stateMask != 0 || !navigationEnabled) { return; } changeCurrentMonth(ctrl ? 12 : 1); break; case SWT.PAGE_UP: if (event.stateMask != 0 || !navigationEnabled) { return; } changeCurrentMonth(ctrl ? -12 : -1); break; case ' ': select(focusIndex, event.stateMask); break; case SWT.HOME: if (event.stateMask != 0) { return; } setFocusOnToday(autoSelectOnFooter); break; default: return; } if (hasFocus) { gridRedraw(); } break; } case SWT.Dispose: { final Display display = getDisplay(); display.removeFilter(SWT.FocusIn, filter); display.removeFilter(SWT.KeyDown, filter); hasFocus = false; break; } } }
Example 12
Source File: TableCombo.java From nebula with Eclipse Public License 2.0 | 4 votes |
/** * Handle Combo events * * @param event */ private void comboEvent(final Event event) { switch (event.type) { case SWT.Dispose: removeListener(SWT.Dispose, listener); notifyListeners(SWT.Dispose, event); event.type = SWT.None; if (popup != null && !popup.isDisposed()) { if (!table.isDisposed()) { table.removeListener(SWT.Dispose, listener); } popup.dispose(); } final Shell shell = getShell(); if (!shell.isDisposed()) { shell.removeListener(SWT.Deactivate, listener); } final Display display = getDisplay(); display.removeFilter(SWT.FocusIn, focusFilter); popup = null; text = null; table = null; arrow = null; selectedImage = null; break; case SWT.FocusIn: final Control focusControl = getDisplay().getFocusControl(); if (focusControl == arrow || focusControl == table) { return; } if (!isDropped()) { text.setFocus(); } break; case SWT.Move: dropDown(false); break; case SWT.Resize: internalLayout(false, true); break; } }
Example 13
Source File: KeybindingsManager.java From APICloud-Studio with GNU General Public License v3.0 | 4 votes |
private void initBindings() { WorkbenchJob workbenchJob = new WorkbenchJob("Installing KeybindingsManager") //$NON-NLS-1$ { @Override public IStatus runInUIThread(IProgressMonitor monitor) { loadbindings(); // Insert our key listener before the Eclipse's key listeners IBindingService bindingService = (IBindingService) workbench.getService(IBindingService.class); if (bindingService instanceof BindingService) { final BindingService theBindingService = (BindingService) bindingService; Display display = PlatformUI.getWorkbench().getDisplay(); final WorkbenchKeyboard keyboard = theBindingService.getKeyboard(); Listener keyDownFilter = keyboard.getKeyDownFilter(); try { if (keyDownFilter != null) { display.removeFilter(SWT.KeyDown, keyDownFilter); display.removeFilter(SWT.Traverse, keyDownFilter); } display.addFilter(SWT.KeyDown, listener); display.addFilter(SWT.Traverse, listener); } finally { if (keyDownFilter != null) { display.addFilter(SWT.KeyDown, keyDownFilter); display.addFilter(SWT.Traverse, keyDownFilter); } } } // Set the initial enabled state of KeybindingsManager IContextService contextService = (IContextService) workbench.getService(IContextService.class); contextService.addContextManagerListener(contextManagerListener); setEnabled(contextService.getActiveContextIds().contains(ScriptingUIPlugin.SCRIPTING_CONTEXT_ID)); return Status.OK_STATUS; } }; workbenchJob.setRule(MUTEX_RULE); EclipseUtil.setSystemForJob(workbenchJob); workbenchJob.setPriority(Job.LONG); workbenchJob.schedule(); }
Example 14
Source File: DataItemCombo.java From birt with Eclipse Public License 1.0 | 4 votes |
void comboEvent( Event event ) { switch ( event.type ) { case SWT.Dispose : removeListener( SWT.Dispose, listener ); notifyListeners( SWT.Dispose, event ); event.type = SWT.None; if ( popup != null && !popup.isDisposed( ) ) { list.removeListener( SWT.Dispose, listener ); popup.dispose( ); } Shell shell = getShell( ); shell.removeListener( SWT.Deactivate, listener ); Display display = getDisplay( ); display.removeFilter( SWT.FocusIn, filter ); popup = null; text = null; list = null; arrow = null; _shell = null; break; case SWT.FocusIn : Control focusControl = getDisplay( ).getFocusControl( ); if ( focusControl == arrow || focusControl == list ) return; if ( isDropped( ) ) { list.setFocus( ); } else { text.setFocus( ); } break; case SWT.Move : dropDown( false ); break; case SWT.Resize : internalLayout( false ); break; } }