public Object getAdapter(Class key) { if (key == AutoexposeHelper.class) return new ViewportAutoexposeHelper(this); if (key == ExposeHelper.class) return new ViewportExposeHelper(this); if (key == MouseWheelHelper.class) return new ViewportMouseWheelHelper(this); return super.getAdapter(key); }
/** * Updates the active {@link AutoexposeHelper}. Does nothing if there is still an active helper. Otherwise, obtains a * new helper (possible <code>null</code>) at the current mouse location and calls * {@link #setAutoexposeHelper(AutoexposeHelper)}. */ protected void updateAutoexposeHelper() { if (exposeHelper != null) return; AutoexposeHelper.Search search = new AutoexposeHelper.Search(getLocation()); getCurrentViewer().findObjectAtExcluding(getLocation(), Collections.EMPTY_LIST, search); setAutoexposeHelper(search.result); }
/** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ @SuppressWarnings("rawtypes") public Object getAdapter(Class adapter) { if (adapter == AutoexposeHelper.class) { if (((JDRulerEditPart) getContents()).isHorizontal()) return new ViewportAutoexposeHelper(this, HORIZONTAL_THRESHOLD); return new ViewportAutoexposeHelper(this, VERTICAL_THRESHOLD); } return super.getAdapter(adapter); }
/** * Updates the active {@link AutoexposeHelper}. Does nothing if there is * still an active helper. Otherwise, obtains a new helper (possible * <code>null</code>) at the current mouse location and calls * {@link #setAutoexposeHelper(AutoexposeHelper)}. */ protected void updateAutoexposeHelper() { if (exposeHelper != null) return; AutoexposeHelper.Search search; search = new AutoexposeHelper.Search(getDropLocation()); getViewer().findObjectAtExcluding(getDropLocation(), Collections.EMPTY_LIST, search); setAutoexposeHelper(search.result); }
/** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class adapter) { if (adapter == AutoexposeHelper.class) { if (((RulerEditPart) getContents()).isHorizontal()) return new ViewportAutoexposeHelper(this, HORIZONTAL_THRESHOLD); return new ViewportAutoexposeHelper(this, VERTICAL_THRESHOLD); } return super.getAdapter(adapter); }
/** * Updates the active {@link AutoexposeHelper}. Does nothing if there is * still an active helper. Otherwise, obtains a new helper (possible * <code>null</code>) at the current mouse location and calls * {@link #setAutoexposeHelper(AutoexposeHelper)}. */ protected void updateAutoexposeHelper() { if (exposeHelper != null) return; AutoexposeHelper.Search search; search = new AutoexposeHelper.Search(getLocation()); getCurrentViewer().findObjectAtExcluding(getLocation(), Collections.EMPTY_LIST, search); setAutoexposeHelper(search.result); }
/** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter( Class adapter ) { if ( adapter == AutoexposeHelper.class ) { if ( ( (EditorRulerEditPart) getContents( ) ).isHorizontal( ) ) return new ViewportAutoexposeHelper( this, HORIZONTAL_THRESHOLD ); return new ViewportAutoexposeHelper( this, VERTICAL_THRESHOLD ); } return super.getAdapter( adapter ); }
/** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter( Class adapter ) { if ( adapter == AutoexposeHelper.class ) return new ReportViewportAutoexposeHelper( this ); if ( adapter == IModelEventProcessor.class ) { return getContents( ).getAdapter( IModelEventProcessor.class ); } return super.getAdapter( adapter ); }
@Override protected AutoexposeHelper getAutoexposeHelper() { System.out.println("getAutoexposeHelper()"); return super.getAutoexposeHelper(); }
@Override protected void setAutoexposeHelper(AutoexposeHelper helper) { System.out.println("setAutoexposeHelper("+helper+")"); super.setAutoexposeHelper(helper); }
/** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class adapter) { if (adapter == AutoexposeHelper.class) return new ViewportAutoexposeHelper(this); return super.getAdapter(adapter); }
/** * @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class) */ public Object getAdapter(Class key) { if (key == AutoexposeHelper.class) return new ViewportAutoexposeHelper(this); return super.getAdapter(key); }
public Object getAdapter(Class adapter) { if (adapter == AutoexposeHelper.class /* || adapter == ExposeHelper.class */) return new ViewportAutoexposeHelper(this, new Insets(50, 50, 50, 50)); return super.getAdapter(adapter); }
/** * Sets the active autoexpose helper to the given helper, or <code>null</code>. If the helper is not <code>null</code> * , a runnable is queued on the event thread that will trigger a subsequent {@link #doAutoexpose()}. The helper is * typically updated only on a hover event. * * @param helper * the new autoexpose helper or <code>null</code> */ protected void setAutoexposeHelper(AutoexposeHelper helper) { exposeHelper = helper; if (exposeHelper == null) return; Display.getCurrent().asyncExec(new QueuedAutoexpose()); }
/** * Sets the active autoexpose helper to the given helper, or <code>null</code>. If the helper is not <code>null</code> * , a runnable is queued on the event thread that will trigger a subsequent {@link #doAutoexpose()}. The helper is * typically updated only on a hover event. * * @param helper * the new autoexpose helper or <code>null</code> */ protected void setAutoexposeHelper(AutoexposeHelper helper) { exposeHelper = helper; if (exposeHelper == null) return; Display.getDefault().asyncExec(new QueuedAutoexpose()); }
/** * Sets the active autoexpose helper to the given helper, or * <code>null</code>. If the helper is not <code>null</code>, a runnable is * queued on the event thread that will trigger a subsequent * {@link #doAutoexpose()}. The helper is typically updated only on a hover * event. * * @param helper * the new autoexpose helper or <code>null</code> */ protected void setAutoexposeHelper(AutoexposeHelper helper) { exposeHelper = helper; if (exposeHelper == null) return; Display.getCurrent().asyncExec(new QueuedAutoexpose()); }
/** * Sets the current autoexpose helper. * * @param helper * the autoexpose helper */ protected void setAutoexposeHelper(AutoexposeHelper helper) { exposeHelper = helper; }
/** * Returns <code>null</code> or the current autoexpose helper. * * @return null or a helper */ protected AutoexposeHelper getAutoexposeHelper() { return exposeHelper; }