當前位置: 首頁>>代碼示例>>Java>>正文


Java GridData.GRAB_VERTICAL屬性代碼示例

本文整理匯總了Java中org.eclipse.swt.layout.GridData.GRAB_VERTICAL屬性的典型用法代碼示例。如果您正苦於以下問題:Java GridData.GRAB_VERTICAL屬性的具體用法?Java GridData.GRAB_VERTICAL怎麽用?Java GridData.GRAB_VERTICAL使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在org.eclipse.swt.layout.GridData的用法示例。


在下文中一共展示了GridData.GRAB_VERTICAL屬性的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: SummaryPanel

SummaryPanel(Composite parent) {
    summary = new StyledText(parent, SWT.WRAP | SWT.MULTI | SWT.READ_ONLY | SWT.V_SCROLL);
    summary.setCaret(null);
    summary.setEditable(false);

    GridData gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
    gd.horizontalSpan = 2;
    // gd.heightHint = 100;
    summary.setLayoutData(gd);
    BookNotifier.getInstance().addListener(this);
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:11,代碼來源:SummaryPanel.java

示例2: createDialogArea

protected Control createDialogArea(Composite parent) {
      // create composite
      Composite composite = (Composite) super.createDialogArea(parent);
      // create message
      if (message != null) {
          Label label = new Label(composite, SWT.WRAP);
          label.setText(message);
          GridData data = new GridData(GridData.GRAB_HORIZONTAL
                  | GridData.GRAB_VERTICAL | GridData.HORIZONTAL_ALIGN_FILL
                  | GridData.VERTICAL_ALIGN_CENTER);
          data.widthHint = convertHorizontalDLUsToPixels(IDialogConstants.MINIMUM_MESSAGE_AREA_WIDTH);
          label.setLayoutData(data);
          label.setFont(parent.getFont());
      }
      viewer = new ComboViewer(composite);
      viewer.setContentProvider(new ArrayContentProvider());
      viewer.addSelectionChangedListener(new ISelectionChangedListener() {
	
	@Override
	public void selectionChanged(
			SelectionChangedEvent event) {
		valueSelected(valueFromSelection(event.getSelection())); 
	}
});
      viewer.setLabelProvider(new LabelProvider() {
      	@Override
      	public String getText(Object element) {
      		if (element instanceof String) {
      			return PrefUIUtil.getFolderLabel((String) element, MAX_FOLDER_PATH_LEN);
      		}
      		return super.getText(element);
      	}
      });
      viewer.getControl().setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
              | GridData.HORIZONTAL_ALIGN_FILL));
      
      createLink(composite, "From folder", ()->addFolder());
      
      createLink(composite, "From workspace prefs", ()->addWorkspace());
      
      createLink(composite, "From installation", ()->addInstallation());
      
      createLink(composite, "From launch config", ()->addLaunchCfg());
      
      errorMessageText = new Text(composite, SWT.READ_ONLY | SWT.WRAP);
      errorMessageText.setLayoutData(new GridData(GridData.GRAB_HORIZONTAL
              | GridData.HORIZONTAL_ALIGN_FILL));
      errorMessageText.setBackground(errorMessageText.getDisplay()
              .getSystemColor(SWT.COLOR_WIDGET_BACKGROUND));
      // Set the error message text
      // See https://bugs.eclipse.org/bugs/show_bug.cgi?id=66292
      setErrorMessage(errorMessage);

      applyDialogFont(composite);
      return composite;
  }
 
開發者ID:32kda,項目名稱:com.onpositive.prefeditor,代碼行數:56,代碼來源:FolderSelectionDialog.java

示例3: expandVertical

public void expandVertical() {
    gdstyle |= GridData.VERTICAL_ALIGN_FILL;
    gdstyle |= GridData.GRAB_VERTICAL;
}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:4,代碼來源:GridComposite.java

示例4: init

public void init(int attributes) {
    if (table != null)
        throw new InvalidParameterException("init already called on table!");

    table = new Table(parent, attributes);
    table.setHeaderVisible(true);
    if (oddEvenColors)
        enableBasicOddEvenColors();

    GridData gd = new GridData(GridData.FILL_BOTH | GridData.GRAB_VERTICAL | GridData.GRAB_HORIZONTAL);
    table.setLayoutData(gd);
    assert (tableColumns.size() == 0);

    layoutColumns();

    table.setVisible(true);

    table.setData(this);
    table.setFont(FontShop.tableFont());

    addKeyBoardListener();

    if (parent instanceof SelectionListener)
        addSelectionListener((SelectionListener) parent);

    addSelectionListener(this);

    enableBasicOddEvenColors();

}
 
開發者ID:openaudible,項目名稱:openaudible,代碼行數:30,代碼來源:EnumTable.java


注:本文中的org.eclipse.swt.layout.GridData.GRAB_VERTICAL屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。