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


Java IDialogFieldListener类代码示例

本文整理汇总了Java中org.eclipse.xtext.ui.editor.tasks.dialogfields.IDialogFieldListener的典型用法代码示例。如果您正苦于以下问题:Java IDialogFieldListener类的具体用法?Java IDialogFieldListener怎么用?Java IDialogFieldListener使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


IDialogFieldListener类属于org.eclipse.xtext.ui.editor.tasks.dialogfields包,在下文中一共展示了IDialogFieldListener类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getProjectValueListener

import org.eclipse.xtext.ui.editor.tasks.dialogfields.IDialogFieldListener; //导入依赖的package包/类
private IDialogFieldListener getProjectValueListener() {
  return new IDialogFieldListener() {
    public void dialogFieldChanged(final DialogField field) {
      projectNameStatus = validator.checkProjectName(getProjectName());
      handleFieldChanged(field.toString());
    }
  };
}
 
开发者ID:dsldevkit,项目名称:dsl-devkit,代码行数:9,代码来源:NewCheckProjectWizardPage.java

示例2: createDescriptionLabel

import org.eclipse.xtext.ui.editor.tasks.dialogfields.IDialogFieldListener; //导入依赖的package包/类
/** copied from PropertyAndPreferencePage */
@Override
protected Label createDescriptionLabel(Composite parent) {
	parentComposite = parent;
	if (isProjectPreferencePage()) {
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout = new GridLayout();
		layout.marginHeight = 0;
		layout.marginWidth = 0;
		layout.numColumns = 2;
		composite.setLayout(layout);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		IDialogFieldListener listener = new IDialogFieldListener() {
			@Override
			public void dialogFieldChanged(DialogField dialogField) {
				boolean enabled = ((SelectionButtonDialogField) dialogField).isSelected();
				enableProjectSpecificSettings(enabled);
				projectSpecificChanged = true;

				if (enabled && getData() != null) {
					applyData(getData());
				}
			}
		};

		useProjectSettings = new SelectionButtonDialogField(SWT.CHECK);
		useProjectSettings.setDialogFieldListener(listener);
		useProjectSettings
				.setLabelText(org.eclipse.xtext.ui.preferences.Messages.PropertyAndPreferencePage_useprojectsettings_label);
		useProjectSettings.doFillIntoGrid(composite, 1);
		LayoutUtil.setHorizontalGrabbing(useProjectSettings.getSelectionButton(null));

		if (offerLink()) {
			changeWorkspaceSettings = createLink(composite,
					org.eclipse.xtext.ui.preferences.Messages.PropertyAndPreferencePage_useworkspacesettings_change);
			changeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
		} else {
			LayoutUtil.setHorizontalSpan(useProjectSettings.getSelectionButton(null), 2);
		}

		Label horizontalLine = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
		horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
		horizontalLine.setFont(composite.getFont());
	} else if (supportsProjectSpecificOptions() && offerLink()) {
		changeWorkspaceSettings = createLink(
				parent,
				org.eclipse.xtext.ui.preferences.Messages.PropertyAndPreferencePage_showprojectspecificsettings_label);
		changeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
	}

	return super.createDescriptionLabel(parent);
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:55,代码来源:AbstractN4JSPreferencePage.java

示例3: createDescriptionLabel

import org.eclipse.xtext.ui.editor.tasks.dialogfields.IDialogFieldListener; //导入依赖的package包/类
@Override
protected Label createDescriptionLabel(Composite parent) {
	parentComposite = parent;
	if (isProjectPreferencePage()) {
		Composite composite = new Composite(parent, SWT.NONE);
		composite.setFont(parent.getFont());
		GridLayout layout = new GridLayout();
		layout.marginHeight = 0;
		layout.marginWidth = 0;
		layout.numColumns = 2;
		composite.setLayout(layout);
		composite.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false));

		IDialogFieldListener listener = new IDialogFieldListener() {
			public void dialogFieldChanged(DialogField field) {
				boolean enabled = ((SelectionButtonDialogField) field).isSelected();
				enableProjectSpecificSettings(enabled);

				if (enabled && getData() != null) {
					applyData(getData());
				}
			}
		};

		useProjectSettings = new SelectionButtonDialogField(SWT.CHECK);
		useProjectSettings.setDialogFieldListener(listener);
		useProjectSettings.setLabelText(Messages.PropertyAndPreferencePage_useprojectsettings_label);
		useProjectSettings.doFillIntoGrid(composite, 1);
		LayoutUtil.setHorizontalGrabbing(useProjectSettings.getSelectionButton(null));

		if (offerLink()) {
			changeWorkspaceSettings = createLink(composite,
					Messages.PropertyAndPreferencePage_useworkspacesettings_change);
			changeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, false, false));
		} else {
			LayoutUtil.setHorizontalSpan(useProjectSettings.getSelectionButton(null), 2);
		}

		Label horizontalLine = new Label(composite, SWT.SEPARATOR | SWT.HORIZONTAL);
		horizontalLine.setLayoutData(new GridData(GridData.FILL, GridData.FILL, true, false, 2, 1));
		horizontalLine.setFont(composite.getFont());
	} else if (supportsProjectSpecificOptions() && offerLink()) {
		changeWorkspaceSettings = createLink(parent,
				Messages.PropertyAndPreferencePage_showprojectspecificsettings_label);
		changeWorkspaceSettings.setLayoutData(new GridData(SWT.END, SWT.CENTER, true, false));
	}

	return super.createDescriptionLabel(parent);
}
 
开发者ID:cplutte,项目名称:bts,代码行数:50,代码来源:PropertyAndPreferencePage.java


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