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


Java LayoutConstants.getMargins方法代码示例

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


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

示例1: createDialogArea

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(final Composite parent) {
  Composite dialogArea = (Composite) super.createDialogArea(parent);

  Composite container = new Composite(dialogArea, SWT.NONE);
  Link flexPricing = new Link(container, SWT.WRAP);
  flexPricing.setText(Messages.getString("deploy.preferences.dialog.flex.pricing")); //$NON-NLS-1$
  flexPricing.addSelectionListener(
      new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
  FontUtil.convertFontToItalic(flexPricing);

  GridDataFactory.fillDefaults().grab(true, true).applyTo(container);
  Point margins = LayoutConstants.getMargins();
  GridLayoutFactory.fillDefaults()
      .extendedMargins(margins.x, margins.x, 0 /* no upper margin */, margins.y)
      .generateLayout(container);

  return dialogArea;
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:20,代码来源:FlexDeployPreferencesDialog.java

示例2: createDialogArea

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite contents = new Composite(parent, SWT.NONE);
	contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	setTitle("Create new project");
	getShell().setText("Create new project");

	if (labelText != null) {
		setMessage(labelText);
	} else {
		setMessage("Enter the name and the description of the project");
	}

	Label name = new Label(contents, SWT.NULL);
	name.setText("Name:");
	txtProjectName = new Text(contents, SWT.SINGLE | SWT.BORDER);
	txtProjectName.setSize(150, 20);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y)
		.generateLayout(contents);

	return contents;
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:28,代码来源:CreateProjectDialog.java

示例3: createDialogArea

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite parentComposite = (Composite) super.createDialogArea(parent);

	Composite contents = new Composite(parentComposite, SWT.NONE);
	GridLayout layout = new GridLayout();
	contents.setLayout(layout);
	GridData gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	contents.setLayoutData(gridData);

	Composite converterComposite = new Composite(contents, SWT.NONE);
	converterComposite.setLayout(new GridLayout(2, false));

	gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	converterComposite.setLayoutData(gridData);

	String direction = converterViewModel.getDirection();
	if (direction.equals(Converter.DIRECTION_POSITIVE)) {
		supportList = createConvertControl(Messages.getString("dialog.ConfigConversionDialog.direction1"), converterComposite);
	} else {
		supportList = createConvertControl(Messages.getString("dialog.ConfigConversionDialog.direction2"), converterComposite);
	}
	supportList.getCombo().setFocus();

	bindValue();

	Dialog.applyDialogFont(parentComposite);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y).generateLayout(
			contents);

	return contents;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:39,代码来源:ConfigConversionDialog.java

示例4: createControl

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	initData(); // 先初始化本页面需要的数据

	Composite contents = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	contents.setLayout(layout);
	GridData gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	contents.setLayoutData(gridData);

	createFilesGroup(contents); // 文件列表区域
	createPropertiesGroup(contents); // 源文件属性区域组
	createConversionOptionsGroup(contents); // 转换选项组

	bindValue(); // 数据绑定

	try {
		loadFiles(); // 加载文件列表
	} catch (Exception e) {
		e.printStackTrace();
	}

	filesTable.select(0); // 默认选中第一行数据
	filesTable.notifyListeners(SWT.Selection, null);

	Dialog.applyDialogFont(parent);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(1).margins(defaultMargins.x, defaultMargins.y)
			.generateLayout(contents);

	setControl(contents);

	validate();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:37,代码来源:ReverseConversionWizardPage.java

示例5: createDialogArea

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite parentComposite = (Composite) super.createDialogArea(parent);

	Composite contents = new Composite(parentComposite, SWT.NONE);
	GridLayout layout = new GridLayout();
	contents.setLayout(layout);
	GridData gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	contents.setLayoutData(gridData);

	Composite converterComposite = new Composite(contents, SWT.NONE);
	converterComposite.setLayout(new GridLayout(2, false));

	gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	converterComposite.setLayoutData(gridData);

	String direction = converterViewModel.getDirection();
	if (direction.equals(Converter.DIRECTION_POSITIVE)) {
		supportList = createConvertControl("Convert from Suport format to Xliff", converterComposite);
	} else {
		supportList = createConvertControl("Convert from Xliff to Support format", converterComposite);
	}
	supportList.getCombo().setFocus();

	bindValue();

	Dialog.applyDialogFont(parentComposite);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y).generateLayout(
			contents);

	return contents;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:39,代码来源:ConfigConversionDialog.java

示例6: createControl

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
public void createControl(Composite parent) {
	Composite contents = new Composite(parent, SWT.NONE);
	GridLayout layout = new GridLayout();
	contents.setLayout(layout);
	GridData gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	contents.setLayoutData(gridData);

	createFilesGroup(contents); // 文件列表区域
	createPropertiesGroup(contents);// 源文件属性区域组
	createConversionOptionsGroup(contents); // 转换选项组
	createSegmentationGroup(contents); // 分段规则选择区域组

	bindValue(); // 数据绑定

	loadFiles(); // 加载文件列表

	filesTable.select(0); // 默认选中第一行数据
	filesTable.notifyListeners(SWT.Selection, null);

	Dialog.applyDialogFont(parent);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(1).margins(defaultMargins.x, defaultMargins.y)
			.generateLayout(contents);

	setControl(contents);

	srxFile.setText(ConverterContext.defaultSrx);

	validate();
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:34,代码来源:ConversionWizardPage.java

示例7: createDialogArea

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
/**
 * @param parent
 *            parent composite
 * @return Control
 * @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
 */
@Override
protected Control createDialogArea(Composite parent) {
	// Set the specific help for this Composite
	PlatformUI.getWorkbench().getHelpSystem().setHelp(parent, Activator.PLUGIN_ID + ".help_import_ldap");

	Composite contents = new Composite(parent, SWT.NONE);
	contents.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));

	setTitle("LDAP server data");
	setMessage("Enter data of server to connect to");

	Label name = new Label(contents, SWT.NULL);
	name.setText("Server name:");
	serverName = new Text(contents, SWT.SINGLE | SWT.BORDER);
	serverName.setSize(350, 20);

	Label desc = new Label(contents, SWT.NULL);
	desc.setText("Server base:");
	ldapBase = new Text(contents, SWT.SINGLE | SWT.BORDER);
	ldapBase.setSize(350, 20);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y)
		.generateLayout(contents);

	return contents;
}
 
开发者ID:edgarmueller,项目名称:emfstore-rest,代码行数:34,代码来源:LdapSourceDialog.java

示例8: createDialogArea

import org.eclipse.jface.layout.LayoutConstants; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	shell = parent.getShell();

	Composite parentComposite = (Composite) super.createDialogArea(parent);

	Composite contents = new Composite(parentComposite, SWT.NONE);
	GridLayout layout = new GridLayout();
	contents.setLayout(layout);
	GridData gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	contents.setLayoutData(gridData);

	Composite uploadComposite = new Composite(contents, SWT.NONE);
	uploadComposite.setLayout(new GridLayout());

	gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	uploadComposite.setLayoutData(gridData);

	upload = new Upload(uploadComposite, SWT.BORDER, Upload.SHOW_UPLOAD_BUTTON | Upload.SHOW_PROGRESS);
	gridData = new GridData();
	gridData.horizontalAlignment = SWT.FILL;
	gridData.grabExcessHorizontalSpace = true;
	upload.setLayoutData(gridData);

	upload.addUploadListener(new UploadAdapter() {
		@Override
		public void uploadFinished(UploadEvent uploadEvent) {
			if (uploadEvent.isFinished()) {
				MessageDialog.openInformation(shell, "上传成功", "文件上传成功");
				// 确保关闭之前的文件 IO
				if (lastUploadItem != null) {
					InputStream is = lastUploadItem.getFileInputStream();
					if (is != null) {
						try {
							is.close();
						} catch (IOException e) {
							// ignore the exception
							if (LOGGER.isErrorEnabled()) {
								LOGGER.error("关闭上传的文件流失败。", e);
							}
						}
					}
				}
				lastUploadItem = upload.getUploadItem();
			}
		}
	});

	Dialog.applyDialogFont(parentComposite);

	Point defaultMargins = LayoutConstants.getMargins();
	GridLayoutFactory.fillDefaults().numColumns(2).margins(defaultMargins.x, defaultMargins.y).generateLayout(
			contents);

	return contents;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:61,代码来源:FileUploadConversionItemDialog.java


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