hori.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { redraw(); vert.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { redraw();
hori.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { redraw(); vert.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { redraw();
vert = canvas.getVerticalBar(); hori.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { redraw(); vert.addSelectionListener( new SelectionAdapter() { public void widgetSelected( SelectionEvent e ) { redraw();
sbVertical.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e ) { sbHorizontal.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e ) {
vert = canvas.getVerticalBar(); hori.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e ) { vert.addSelectionListener( new SelectionAdapter() { @Override public void widgetSelected( SelectionEvent e ) {
/** * {@inheritDoc} */ public void addSelectionListener(SelectionListener listener) { scrollBar.addSelectionListener(listener); }
public void install(AbstractThemedScrollBarAdapter abstractThemedScrollBarAdapter) { if (this.fScrollBar != null) { fScrollBar.setVisible(false); this.fScrollBar.addSelectionListener(abstractThemedScrollBarAdapter); } }
private void initScrollBarListener() { ScrollBar scroll = getTable().getVerticalBar(); fScrollSelectionListener = new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { handleScrollBarSelection(); } }; scroll.addSelectionListener(fScrollSelectionListener); }
/** * Initializes all listeners and structures required to set up view port listeners. */ private void initializeViewportUpdate() { if (fViewportGuard != null) return; if (fTextWidget != null) { fViewportGuard= new ViewportGuard(); fLastTopPixel= -1; fTextWidget.addKeyListener(fViewportGuard); fTextWidget.addMouseListener(fViewportGuard); fScroller= fTextWidget.getVerticalBar(); if (fScroller != null) fScroller.addSelectionListener(fViewportGuard); } }
/** * Initializes all listeners and structures required to set up view port listeners. */ private void initializeViewportUpdate() { if (fViewportGuard != null) return; if (fTextWidget != null) { fViewportGuard= new ViewportGuard(); fLastTopPixel= -1; fTextWidget.addKeyListener(fViewportGuard); fTextWidget.addMouseListener(fViewportGuard); fScroller= fTextWidget.getVerticalBar(); if (fScroller != null) fScroller.addSelectionListener(fViewportGuard); } }
private void hsynchViewport(final TextViewer tv1, final TextViewer tv2, final TextViewer tv3) { final StyledText st1= tv1.getTextWidget(); final StyledText st2= tv2.getTextWidget(); final StyledText st3= tv3.getTextWidget(); final ScrollBar sb1= st1.getHorizontalBar(); sb1.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { if (fSynchronizedScrolling) { int v= sb1.getSelection(); if (st2.isVisible()) st2.setHorizontalPixel(v); if (st3.isVisible()) st3.setHorizontalPixel(v); } } }); }
/** * Configure shell. */ void createContent(Composite parent) { canvas = new Canvas(parent, SWT.DOUBLE_BUFFERED | SWT.NONE | SWT.NO_REDRAW_RESIZE | SWT.V_SCROLL | SWT.H_SCROLL); canvas.setBackground(display.getSystemColor(SWT.COLOR_WIDGET_BACKGROUND)); origin = new org.eclipse.swt.graphics.Point(0, 0); size = START_SCREEN_SIZE; canvas.addPaintListener(this); canvas.addControlListener(this); this.layout(); timeLabel = new Label(canvas, SWT.NONE); timeLabel.setText("hello world"); timeLabel.pack(); timeLabel.setLocation(TIME_LABEL_LOC); timeLabel .setBackground(canvas.getDisplay().getSystemColor(SWT.COLOR_WHITE)); hBar = canvas.getHorizontalBar(); hBar.addSelectionListener(this); vBar = canvas.getVerticalBar(); vBar.addSelectionListener(this); }
private void hsynchViewport(final TextViewer tv1, final TextViewer tv2, final TextViewer tv3) { final StyledText st1= tv1.getTextWidget(); final StyledText st2= tv2.getTextWidget(); final StyledText st3= tv3.getTextWidget(); final ScrollBar sb1= st1.getHorizontalBar(); sb1.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { if (fSynchronizedScrolling) { int max= sb1.getMaximum()-sb1.getThumb(); double v= 0.0; if (max > 0) v= (float)sb1.getSelection() / (float)max; if (st2.isVisible()) { ScrollBar sb2= st2.getHorizontalBar(); st2.setHorizontalPixel((int)((sb2.getMaximum()-sb2.getThumb()) * v)); } if (st3.isVisible()) { ScrollBar sb3= st3.getHorizontalBar(); st3.setHorizontalPixel((int)((sb3.getMaximum()-sb3.getThumb()) * v)); } workaround65205(); } } }); }
innerForm.setLayoutData(new GridData(GridData.FILL_BOTH)); final ScrollBar scrollBar = innerForm.getVerticalBar(); scrollBar.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { updateSeparatorVisibility();
/** * Installs this closer on the given table opened by the given content assistant. * * @param contentAssistant the content assistant * @param table the table to be tracked */ public void install(ContentAssistant2 contentAssistant, Table table) { fContentAssistant= contentAssistant; fTable= table; if (Helper2.okToUse(fTable)) { Shell shell= fTable.getShell(); if (Helper2.okToUse(shell)) { fShell= shell; fShell.addShellListener(this); } fTable.addFocusListener(this); fScrollbar= fTable.getVerticalBar(); if (fScrollbar != null) fScrollbar.addSelectionListener(this); } }
/** * Installs this closer on the given table opened by the given content assistant. * * @param contentAssistant the content assistant * @param table the table to be tracked */ public void install(ContentAssistant2 contentAssistant, Table table) { fContentAssistant= contentAssistant; fTable= table; if (Helper2.okToUse(fTable)) { Shell shell= fTable.getShell(); if (Helper2.okToUse(shell)) { fShell= shell; fShell.addShellListener(this); } fTable.addFocusListener(this); fScrollbar= fTable.getVerticalBar(); if (fScrollbar != null) fScrollbar.addSelectionListener(this); } }
/** * Installs this closer on the given table opened by the given content assistant. * * @param contentAssistant the content assistant * @param table the table to be tracked * @param additionalInfoController the additional info controller, or <code>null</code> * @since 3.4 */ public void install(ContentAssistant contentAssistant, Table table, AdditionalInfoController additionalInfoController) { fContentAssistant= contentAssistant; fTable= table; fAdditionalInfoController= additionalInfoController; if (Helper.okToUse(fTable)) { fShell= fTable.getShell(); fDisplay= fShell.getDisplay(); fShell.addShellListener(this); fTable.addFocusListener(this); fScrollbar= fTable.getVerticalBar(); if (fScrollbar != null) fScrollbar.addSelectionListener(this); fDisplay.addFilter(SWT.Activate, this); fDisplay.addFilter(SWT.MouseVerticalWheel, this); fDisplay.addFilter(SWT.Deactivate, this); fDisplay.addFilter(SWT.MouseUp, this); } }
/** * Installs this closer on the given table opened by the given content assistant. * * @param contentAssistant the content assistant * @param table the table to be tracked * @param additionalInfoController the additional info controller, or <code>null</code> * @since 3.4 */ public void install(ContentAssistant contentAssistant, Table table, AdditionalInfoController additionalInfoController) { fContentAssistant= contentAssistant; fTable= table; fAdditionalInfoController= additionalInfoController; if (Helper.okToUse(fTable)) { fShell= fTable.getShell(); fDisplay= fShell.getDisplay(); fShell.addShellListener(this); fTable.addFocusListener(this); fScrollbar= fTable.getVerticalBar(); if (fScrollbar != null) fScrollbar.addSelectionListener(this); fDisplay.addFilter(SWT.Activate, this); fDisplay.addFilter(SWT.MouseVerticalWheel, this); fDisplay.addFilter(SWT.Deactivate, this); fDisplay.addFilter(SWT.MouseUp, this); } }
ScrollBar vBar= scrollable.getVerticalBar(); if (vBar != null) vBar.addSelectionListener(this); ScrollBar hBar= scrollable.getHorizontalBar(); if (hBar != null) hBar.addSelectionListener(this);
ScrollBar vBar= scrollable.getVerticalBar(); if (vBar != null) vBar.addSelectionListener(this); ScrollBar hBar= scrollable.getHorizontalBar(); if (hBar != null) hBar.addSelectionListener(this);