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


Java GridLayoutFactory類代碼示例

本文整理匯總了Java中org.eclipse.jface.layout.GridLayoutFactory的典型用法代碼示例。如果您正苦於以下問題:Java GridLayoutFactory類的具體用法?Java GridLayoutFactory怎麽用?Java GridLayoutFactory使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: createBottomControls

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
/**
 * Creates the bottom controls.
 */
private void createBottomControls(Composite parent) {
	Composite bottomControls = new Composite(parent, SWT.NONE);

	bottomControls
			.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).align(SWT.RIGHT, SWT.CENTER).create());
	bottomControls.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).extendedMargins(0, 5, 0, 0).create());

	previewToggleButton = new Button(bottomControls, SWT.PUSH);
	previewToggleButton.setText(HIDE_PREVIEW_TEXT);
	previewToggleButton.setSelection(true);
	previewToggleButton.setLayoutData(GridDataFactory.fillDefaults().align(SWT.RIGHT, SWT.BOTTOM).create());
	previewToggleButton.setToolTipText(PREVIEW_BUTTON_TOOLTIP);

	previewToggleButton.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			if (!previewVisible) {
				showContentPreview();
			} else {
				hideContentPreview();
			}
		}
	});
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:28,代碼來源:PreviewableWizardPage.java

示例2: createControl

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@Override
public void createControl(Composite parent) {
	paneComposite = new Composite(parent, SWT.NONE);
	paneComposite.setLayout(GridLayoutFactory.fillDefaults().numColumns(2).equalWidth(true).create());

	super.createControl(paneComposite);
	workspaceWizardControl.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());

	createPreview(paneComposite);
	createBottomControls(paneComposite);

	setControl(paneComposite);

	boolean hidePreviewSetting = getDialogSettings().getBoolean(DIALOG_SETTING_HIDE_PREVIEW_KEY);

	if (hidePreviewSetting) {
		hideContentPreview();
	} else {
		// Otherwise just make sure the shell size is set
		getShell().setMinimumSize(PREVIEW_MINIMUM_SHELL_SIZE);
	}
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:23,代碼來源:PreviewableWizardPage.java

示例3: createNameArea

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
private void createNameArea(Composite parent, String areaName, Consumer<String> textHandler) {
	final Group area = new Group(parent, SHADOW_ETCHED_IN);
	area.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());
	area.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).create());
	area.setText(areaName);

	final Text txtPackageName = getSimpleTextArea(area);
	txtPackageName.addModifyListener(new ModifyListener() {

		@Override
		public void modifyText(ModifyEvent e) {
			Text textWidget = (Text) e.getSource();
			textHandler.accept(textWidget.getText());
		}
	});
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:17,代碼來源:InstallNpmDependencyDialog.java

示例4: build

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
/**
 * Builds the new column viewer instance.
 *
 * @param parent
 *            the parent composite for the viewer.
 * @return the new new column viewer.
 */
public final CV build(final Composite parent) {

	final Composite container = new Composite(parent, NONE);
	container.setLayout(GridLayoutFactory.fillDefaults().create());
	container.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(FILL, FILL).create());

	final Composite composite = new Composite(container, NONE);
	composite.setLayout(GridLayoutFactory.fillDefaults().create());
	composite.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).align(FILL, FILL).create());

	final AbstractColumnLayout layout = createColumnLayout();
	composite.setLayout(layout);

	final CV viewer = createViewer(composite, layout, NONE | V_SCROLL | H_SCROLL | getStyle());

	viewer.setContentProvider(contentProvider);
	viewer.setLabelProvider(labelProvider);
	viewer.setUseHashlookup(useHashlookup);

	return viewer;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:29,代碼來源:ColumnViewerBuilder.java

示例5: createVendorIdControls

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private void createVendorIdControls(DataBindingContext dbc, Composite parent) {
	final Composite composite = new Composite(parent, SWT.NULL);
	composite.setLayout(GridLayoutFactory.swtDefaults().numColumns(2).create());
	composite.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

	final Label vendorIdLabel = new Label(composite, SWT.NONE);
	vendorIdLabel.setText("Vendor id:");

	Text vendorIdText = new Text(composite, SWT.BORDER);
	vendorIdText.setLayoutData(fillDefaults().align(FILL, FILL).grab(true, true).create());

	projectInfo.addPropertyChangeListener(event -> {
		if (event.getPropertyName().equals(N4MFProjectInfo.VENDOR_ID_PROP_NAME)) {
			setPageComplete(validatePage());
		}
	});

	dbc.bindValue(WidgetProperties.text(Modify).observe(vendorIdText),
			BeanProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.VENDOR_ID_PROP_NAME).observe(projectInfo));

}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:23,代碼來源:N4MFWizardNewProjectCreationPage.java

示例6: initTestProjectUI

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
private Composite initTestProjectUI(DataBindingContext dbc, Composite parent) {
	// Additional test project options
	final Group testProjectOptionsGroup = new Group(parent, NONE);
	testProjectOptionsGroup.setLayout(GridLayoutFactory.fillDefaults().numColumns(1).create());

	final Button createTestGreeterFileButton = new Button(testProjectOptionsGroup, CHECK);
	createTestGreeterFileButton.setText("Create a test project greeter file");

	final Button addNormalSourceFolderButton = new Button(testProjectOptionsGroup, CHECK);
	addNormalSourceFolderButton.setText("Also create a non-test source folder");

	Label nextPageHint = new Label(testProjectOptionsGroup, NONE);
	nextPageHint.setText("The projects which should be tested can be selected on the next page");
	nextPageHint.setForeground(Display.getCurrent().getSystemColor(SWT.COLOR_TITLE_INACTIVE_FOREGROUND));

	initTestProjectBinding(dbc, addNormalSourceFolderButton, createTestGreeterFileButton);

	return testProjectOptionsGroup;
}
 
開發者ID:eclipse,項目名稱:n4js,代碼行數:20,代碼來源:N4MFWizardNewProjectCreationPage.java

示例7: createDialogArea

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parent)
{
	Composite dialogArea = (Composite) super.createDialogArea(parent);
	Composite composite = new Composite(dialogArea, SWT.NONE);
	createMessageArea(composite);
	listViewer = new TableViewer(composite, SWT.TOP | SWT.BORDER);

	GridData data = new GridData(GridData.FILL_BOTH);
	data.widthHint = 400;
	data.heightHint = 400;
	listViewer.getTable().setLayoutData(data);
	listViewer.setLabelProvider(WorkbenchLabelProvider.getDecoratingWorkbenchLabelProvider());
	listViewer.setContentProvider(new JarProjectContentProvider(null));
	listViewer.setComparator(new ViewerComparator());
	listViewer.setInput(ResourcesPlugin.getWorkspace());
	applyDialogFont(composite);

	listViewer.setSelection(new StructuredSelection(initialSelection));
	GridLayoutFactory.fillDefaults().generateLayout(composite);
	return dialogArea;
}
 
開發者ID:equella,項目名稱:Equella,代碼行數:23,代碼來源:JPFProjectSelectionDialog.java

示例8: createControl

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@Override
public void createControl(Composite parent) {

    Composite comp = new Group(parent, SWT.BORDER);
    setControl(comp);

    GridLayoutFactory.swtDefaults().numColumns(2).applyTo(comp);

    Label label = new Label(comp, SWT.NONE);
    label.setText("Console Text:");
    GridDataFactory.swtDefaults().applyTo(label);

    text = new Text(comp, SWT.BORDER);
    text.setMessage("Console Text");
    GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
}
 
開發者ID:VisuFlow,項目名稱:visuflow-plugin,代碼行數:17,代碼來源:LaunchConfigurationTab.java

示例9: createDialogArea

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
    Composite p = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(p, SWT.NONE);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(container);

    GridLayoutFactory.fillDefaults().margins(10,  10).numColumns(2).applyTo(container);
	new Label(container, SWT.NONE).setText("Pipeline name:");
	
	text = new Text(container, SWT.BORDER);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
	
	text.addModifyListener(new ModifyListener() {
		
		@Override
		public void modifyText(ModifyEvent e) {
			validate(((Text)e.getSource()).getText());
		}
	});
	return container;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:22,代碼來源:NewPipelineDialog.java

示例10: createDialogArea

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
    Composite p = (Composite) super.createDialogArea(parent);
    Composite container = new Composite(p, SWT.NONE);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(container);

    GridLayoutFactory.fillDefaults().margins(10,  10).numColumns(2).applyTo(container);
	new Label(container, SWT.NONE).setText("New name:");
	
	text = new Text(container, SWT.BORDER);
	text.setText(resourceService.getResourceName(resource));
	GridDataFactory.fillDefaults().grab(true, false).applyTo(text);
	
	text.addModifyListener(new ModifyListener() {
		@Override
		public void modifyText(ModifyEvent e) {
			validate(((Text)e.getSource()).getText());
		}
	});
	return container;
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:22,代碼來源:RenameDialog.java

示例11: createContents

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
private void createContents() {
	GridLayoutFactory.swtDefaults().numColumns(2).applyTo(this);

	text = new Text(this, SWT.NONE);
	GridDataFactory.fillDefaults().grab(true, false).applyTo(text);

	Button button = new Button(this, SWT.PUSH);
	button.setText("Browse...");
	button.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			DirectoryDialog fileDialog = new DirectoryDialog(getShell());
			// Set the text
			fileDialog.setText("Select directory");
			// Set filter on .txt files
			String selection = fileDialog.open();
			if (selection != null)
				text.setText(selection);
		}
	});
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:22,代碼來源:BrowseDirText.java

示例12: createContents

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
@Override
protected Control createContents(final Composite parent) {
  ContextHelp.setHelp(parent, ContextHelp.COVERAGE_PREFERENCES);

  final Composite result = new Composite(parent, SWT.NONE);
  GridLayoutFactory.swtDefaults().margins(0, 0).applyTo(result);

  createSessionManagementGroup(result);
  createDefaultScopeGroup(result);
  createCoverageRuntimeGroup(result);

  // Links:
  createLink(result, UIMessages.CoveragePreferencesDecoratorsLink_label,
      DECORATORS_PAGE);
  createLink(result, UIMessages.CoveragePreferencesAnnotationsLink_label,
      ANNOTATIONS_PAGE);

  initialize();
  checkState();
  return result;
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:22,代碼來源:CoveragePreferencePage.java

示例13: createControl

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
public void createControl(Composite parent) {
  initializeDialogUnits(parent);
  parent = new Composite(parent, SWT.NONE);
  GridLayout layout = new GridLayout(1, false);
  parent.setLayout(layout);
  Composite sourceGroup = new Composite(parent, SWT.NONE);
  GridDataFactory.swtDefaults().grab(true, false)
      .align(SWT.FILL, SWT.BEGINNING).applyTo(sourceGroup);
  GridLayoutFactory.swtDefaults().numColumns(5).applyTo(sourceGroup);
  createFileBlock(sourceGroup);
  createUrlBlock(sourceGroup);
  createAgentBlock(sourceGroup);
  createOptionsBlock(parent);
  setControl(parent);
  ContextHelp.setHelp(parent, ContextHelp.SESSION_IMPORT);
  restoreWidgetValues();
  updateStatus();
}
 
開發者ID:eclipse,項目名稱:eclemma,代碼行數:19,代碼來源:SessionImportPage1.java

示例14: createDialogArea

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的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

示例15: createBrowseFileRow

import org.eclipse.jface.layout.GridLayoutFactory; //導入依賴的package包/類
/**
 * Helper method to create a row of a {@link Label}, a {@link Text} for a file path input, and
 * a "browse" {@link Button} to open a {@link FileDialog}.
 *
 * @param fileFieldBasePath a base path that file input fields will treat as a prefix. The path is
 * for 1) relativizing absolute paths in file input fields; and 2) setting the default path for
 * the file chooser dialog.
 */
protected Text createBrowseFileRow(String labelText, String Tooltip,
    IPath fileFieldBasePath, String[] fileDialogfilterExtensions) {
  Label label = new Label(this, SWT.LEAD);
  label.setText(labelText);
  label.setToolTipText(Tooltip);

  Composite secondColumn = new Composite(this, SWT.NONE);
  Text fileField = new Text(secondColumn, SWT.SINGLE | SWT.BORDER);
  fileField.setToolTipText(Tooltip);

  Button browse = new Button(secondColumn, SWT.PUSH);
  browse.setText(Messages.getString("deploy.preferences.dialog.browse"));
  browse.addSelectionListener(
      new RelativeFileFieldSetter(fileField, fileFieldBasePath, fileDialogfilterExtensions));

  GridDataFactory.fillDefaults().applyTo(secondColumn);
  GridDataFactory.swtDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).applyTo(fileField);
  GridLayoutFactory.fillDefaults().numColumns(2).generateLayout(secondColumn);
  return fileField;
}
 
開發者ID:GoogleCloudPlatform,項目名稱:google-cloud-eclipse,代碼行數:29,代碼來源:FlexDeployPreferencesPanel.java


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