當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。