当前位置: 首页>>代码示例>>Java>>正文


Java Button.setVisible方法代码示例

本文整理汇总了Java中org.eclipse.swt.widgets.Button.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Button.setVisible方法的具体用法?Java Button.setVisible怎么用?Java Button.setVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.eclipse.swt.widgets.Button的用法示例。


在下文中一共展示了Button.setVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: createButtonBar

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
@Override
protected Control createButtonBar(Composite parent) {
    final Composite buttonBar = (Composite) super.createButtonBar(parent);

    logout = new Button(buttonBar, SWT.CENTER);
    final GridData layoutData = new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1);
    layoutData.widthHint = 100;
    logout.setLayoutData(layoutData);
    logout.setText("Log Out");
    logout.setVisible(credentials.isKeepLogged());
    logout.addListener(SWT.Selection, e -> {
        credentials.setApplication(null);
        credentials.setUserKey(false, null);
        close();
    });
    logout.moveAbove(super.buttonControl);

    return buttonBar;
}
 
开发者ID:gluonhq,项目名称:ide-plugins,代码行数:20,代码来源:ApplicationsSWT.java

示例2: addIdKeyComposite

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * @param container
 * @return
 */
public Control addIdKeyComposite(Composite container, FTPAuthOperationDetails authOperationDetails) {
	Composite keyFileComposite = new Composite(container, SWT.BORDER);
	keyFileComposite.setLayout(new GridLayout(3, false));
	keyFileComposite.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
	
	FTPWidgetUtility ftpWidgetUtility = new FTPWidgetUtility();
	ftpWidgetUtility.createLabel(keyFileComposite, "User ID");
	ftpWidgetUtility.createText(keyFileComposite, "", SWT.BORDER);
	Button keyFileBrwsBtn1 = new Button(keyFileComposite, SWT.NONE);
	keyFileBrwsBtn1.setVisible(false);
	
	ftpWidgetUtility.createLabel(keyFileComposite, "Public/Private Key");
	Text privateKeyTxt = (Text) ftpWidgetUtility.createText(keyFileComposite, "", SWT.BORDER);
	Button keyFileBrwsBtn = new Button(keyFileComposite, SWT.NONE);
	keyFileBrwsBtn.setText("...");
	
	selectionListener(keyFileBrwsBtn, privateKeyTxt);

	return keyFileComposite;
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:25,代码来源:FTPAuthenticEditorUtility.java

示例3: CategoriesUpperComposite

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
/**
 * Create the composite.
 * @param parent
 * @param classNamelist 
 * @param style
 */
public CategoriesUpperComposite(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(3, false));
	Label lblCategories = new Label(this, SWT.NONE);
	lblCategories.setLayoutData(new GridData(SWT.LEFT, SWT.CENTER, true, false, 1, 1));
	lblCategories.setText("Categories");
	categoriesComposite=(CategoriesComposite)parent;
	btnAddPackages = new Button(this, SWT.NONE);
	btnAddPackages.setText(ADD_CATEGORIES);
	btnAddPackages.setVisible(false);
	createSearchTextBox(this);
	
	addListnersToAddPackageButton(parent);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:21,代码来源:CategoriesUpperComposite.java

示例4: update

import org.eclipse.swt.widgets.Button; //导入方法依赖的package包/类
public void update(String currentPageId) {
	if (composite == null || composite.isDisposed())
		return;
	GC metricsGC = new GC(composite);
	FontMetrics metrics = metricsGC.getFontMetrics();
	metricsGC.dispose();
	List buttons = (List) buttonMap.get(currentPageId);
	Control[] children = composite.getChildren();

	int visibleChildren = 0;
	Button closeButton = getButton(IDialogConstants.CLOSE_ID);

	for (int i = 0; i < children.length; i++) {
		Control control = children[i];
		if (closeButton == control)
			closeButton.dispose();
		else {
			control.setVisible(false);
			setButtonLayoutData(metrics, control, false);
		}
	}
	if (buttons != null) {
		for (int i = 0; i < buttons.size(); i++) {
			Button button = (Button) buttons.get(i);
			button.setVisible(true);
			setButtonLayoutData(metrics, button, true);
			GridData data = (GridData) button.getLayoutData();
			data.exclude = false;
			visibleChildren++;
		}
	}

	GridLayout compositeLayout = (GridLayout) composite.getLayout();
	compositeLayout.numColumns = visibleChildren;
	composite.layout(true);
}
 
开发者ID:capitalone,项目名称:Hydrograph,代码行数:37,代码来源:HydrographInstallationDialog.java


注:本文中的org.eclipse.swt.widgets.Button.setVisible方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。