org.eclipse.swt.widgets.ScrollBar.setVisible()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(7.4k)|赞(0)|评价(0)|浏览(134)

本文整理了Java中org.eclipse.swt.widgets.ScrollBar.setVisible()方法的一些代码示例,展示了ScrollBar.setVisible()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ScrollBar.setVisible()方法的具体详情如下:
包路径:org.eclipse.swt.widgets.ScrollBar
类名称:ScrollBar
方法名:setVisible

ScrollBar.setVisible介绍

[英]Marks the receiver as visible if the argument is true, and marks it invisible otherwise.

If one of the receiver's ancestors is not visible or some other condition makes the receiver not visible, marking it visible may not actually cause it to be displayed.
[中]如果参数为true,则将接收器标记为可见,否则将其标记为不可见。
如果接收者的祖先之一不可见,或者其他一些情况使接收者不可见,那么将其标记为可见实际上可能不会导致其显示。

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

offsetx = 0;
 sbHorizontal.setSelection( 0 );
 sbHorizontal.setVisible( false );
} else {
 offsetx = -sbHorizontal.getSelection();
 sbHorizontal.setVisible( true );
 offsety = 0;
 sbVertical.setSelection( 0 );
 sbVertical.setVisible( false );
} else {
 offsety = sbVertical.getSelection();
 sbVertical.setVisible( true );

代码示例来源:origin: pentaho/pentaho-kettle

vert.setThumb( 100 );
hori.setVisible( true );
vert.setVisible( true );

代码示例来源:origin: pentaho/pentaho-kettle

vert.setThumb( 100 );
hori.setVisible( true );
vert.setVisible( true );

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.nebula.widgets.grid

/**
 * {@inheritDoc}
 */
public void setVisible(boolean visible)
{
  scrollBar.setVisible(visible);
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

public void install(AbstractThemedScrollBarAdapter abstractThemedScrollBarAdapter) {
  if (this.fScrollBar != null) {
    fScrollBar.setVisible(false);
    this.fScrollBar.addSelectionListener(abstractThemedScrollBarAdapter);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.ui

@Override
  public void controlResized(ControlEvent e) {
    fScrolledPageContent.getVerticalBar().setVisible(showVerticalBar);
  }
});

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private void createScrollBars() {
 if( ( style & SWT.H_SCROLL ) != 0 ) {
  horizontalBar = new ScrollBar( this, SWT.H_SCROLL );
  horizontalBar.setVisible( false );
 }
 if( ( style & SWT.V_SCROLL ) != 0 ) {
  verticalBar = new ScrollBar( this, SWT.V_SCROLL );
  verticalBar.setVisible( false );
 }
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

@Override
  public void controlResized(ControlEvent e) {
    fScrolledPageContent.getVerticalBar().setVisible(true);
  }
});

代码示例来源:origin: org.eclipse.platform/org.eclipse.e4.ui.css.swt

public void uninstall(AbstractThemedScrollBarAdapter abstractThemedScrollBarAdapter, boolean disposing) {
  fInitialDragPosition = null;
  fScrollBarPositions = null;
  fHandleDrawnRect = null;
  if (this.fScrollBar != null && !this.fScrollBar.isDisposed() && !disposing) {
    this.fScrollBar.removeSelectionListener(abstractThemedScrollBarAdapter);
    // Restore its initial visibility state.
    // Note: don't do this if we're disposing at this moment as
    // StyledText will throw a NPE.
    this.fScrollBar.setVisible(fInitialVisible);
  }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

void updateScrollBars() {
 if( ( style & SWT.NO_SCROLL ) == 0 ) {
  hasVScrollBar = false;
  hasHScrollBar = needsHScrollBar();
  if( needsVScrollBar() ) {
   hasVScrollBar = true;
   hasHScrollBar = needsHScrollBar();
  }
  getHorizontalBar().setVisible( hasHScrollBar );
  getVerticalBar().setVisible( hasVScrollBar );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

void updateScrollBars() {
 if( ( style & SWT.NO_SCROLL ) == 0 ) {
  hasVScrollBar = false;
  hasHScrollBar = needsHScrollBar();
  if( needsVScrollBar() ) {
   hasVScrollBar = true;
   hasHScrollBar = needsHScrollBar();
  }
  getHorizontalBar().setVisible( hasHScrollBar );
  getVerticalBar().setVisible( hasVScrollBar );
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

void updateScrollBars() {
  hasVScrollBar = false;
  hasHScrollBar = needsHScrollBar();
  if( needsVScrollBar() ) {
   hasVScrollBar = true;
   hasHScrollBar = needsHScrollBar();
  }
  ScrollBar hScroll = getHorizontalBar();
  if( hScroll != null ) {
   hScroll.setVisible( hasHScrollBar );
  }
  ScrollBar vScroll = getVerticalBar();
  if( vScroll != null ) {
   vScroll.setVisible( hasVScrollBar );
  }
 }
}

代码示例来源:origin: org.eclipse.rap/org.eclipse.rap.rwt

private void updateScrollBars() {
 ScrollBar vScroll = getVerticalBar();
 if( vScroll != null ) {
  BoxDimensions border = getBorder();
  int availableHeight = getBounds().height - ( border.top + border.bottom ) - spacing;
  vScroll.setVisible( allItemsHeight > availableHeight );
 }
}

代码示例来源:origin: org.eclipse/org.eclipse.compare

private void setSyncScrolling(boolean newMode) {
  if (fSynchronizedScrolling != newMode) {
    fSynchronizedScrolling= newMode;
    
    scrollVertical(0, 0, 0, null);
    
    // throw away central control (Sash or Canvas)
    Control center= getCenterControl();
    if (center != null && !center.isDisposed())
      center.dispose();
    
    fLeft.getTextWidget().getVerticalBar().setVisible(!fSynchronizedScrolling);
    fRight.getTextWidget().getVerticalBar().setVisible(!fSynchronizedScrolling);

    fComposite.layout(true);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.compare

private void setSyncScrolling(boolean newMode) {
  if (fSynchronizedScrolling != newMode) {
    fSynchronizedScrolling= newMode;
    scrollVertical(0, 0, 0, null);
    // throw away central control (Sash or Canvas)
    Control center= getCenterControl();
    if (center != null && !center.isDisposed())
      center.dispose();
    fLeft.getSourceViewer().getTextWidget().getVerticalBar().setVisible(!fSynchronizedScrolling);
    fRight.getSourceViewer().getTextWidget().getVerticalBar().setVisible(!fSynchronizedScrolling);
    fComposite.layout(true);
  }
}

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.s390x

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

代码示例来源:origin: org.eclipse.swt.cocoa.macosx/x86_64

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.aix.ppc

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.swt.win32.win32.x86

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

代码示例来源:origin: org.eclipse.platform/org.eclipse.swt.gtk.linux.ppc

void setScrollBar(ScrollBar bar, int clientArea, int maximum, int margin) {
  int inactive = 1;
  if (clientArea < maximum) {
    bar.setMaximum(maximum - margin);
    bar.setThumb(clientArea - margin);
    bar.setPageIncrement(clientArea - margin);
    if (!alwaysShowScroll) bar.setVisible(true);
  } else if (bar.getThumb() != inactive || bar.getMaximum() != inactive) {
    bar.setValues(bar.getSelection(), bar.getMinimum(), inactive, inactive, bar.getIncrement(), inactive);
  }
}
/**

相关文章