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


Java GridDataFactory类代码示例

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


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

示例1: createBottomControls

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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: createFilterControls

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
protected void createFilterControls(Composite con) {
	Label filterLabel = new Label(con,SWT.NONE);
	filterLabel.setText("Filter:");
	GridDataFactory.swtDefaults().applyTo(filterLabel);
	Text filterText = new Text(con, SWT.BORDER);
	filterText.setMessage("(" + PreferenceFilter.MIN_FILTER_CHARS + " chars at least)");
	filterText.addModifyListener(event -> {
		filterChanged(filterText.getText());
	});
	GridDataFactory.fillDefaults().grab(true,false).applyTo(filterText);
	Button clearBtn = new Button(con, SWT.PUSH);
	clearBtn.setImage(AbstractUIPlugin.imageDescriptorFromPlugin(PrefEditorPlugin.PLUGIN_ID,"icons/clear.gif").createImage());
	GridDataFactory.swtDefaults().applyTo(clearBtn);
	clearBtn.addSelectionListener(new SelectionAdapter() {
		
		@Override
		public void widgetSelected(SelectionEvent e) {
			filterText.setText("");
			filterChanged("");
		}
		
	});
}
 
开发者ID:32kda,项目名称:com.onpositive.prefeditor,代码行数:24,代码来源:ViewerPage.java

示例3: CustomElementSelectionForm

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
/**
 * Create the composite.
 */
public CustomElementSelectionForm(Composite parent, int style) {
	super(parent, style);
	setLayout(new GridLayout(2, false));

	treeViewer = new TreeViewer(this, SWT.BORDER);
	Tree tree = getTreeViewer().getTree();

	// Set a minimum height to prevent weird dialog dimensions
	tree.setLayoutData(GridDataFactory.fillDefaults().grab(true, true).span(2, 1).minSize(0, 200).create());

	elementLabel = new Label(this, SWT.NONE);
	elementLabel.setLayoutData(GridDataFactory.swtDefaults().create());
	elementLabel.setText("New Label");

	elementInput = new SuffixText(this, SWT.BORDER);// new Text(this, SWT.BORDER);
	elementInput.setLayoutData(GridDataFactory.fillDefaults().grab(true, false).create());
}
 
开发者ID:eclipse,项目名称:n4js,代码行数:21,代码来源:CustomElementSelectionForm.java

示例4: createControl

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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

示例5: createNameArea

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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

示例6: build

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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

示例7: createTitleControl

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createTitleControl(Composite parent) {
	text = new Text(parent, SWT.NONE);

	GridData textLayoutData = new GridData();
	textLayoutData.horizontalAlignment = GridData.FILL;
	textLayoutData.verticalAlignment = GridData.FILL;
	textLayoutData.grabExcessHorizontalSpace = true;
	textLayoutData.grabExcessVerticalSpace = false;
	textLayoutData.horizontalSpan = 2;

	text.setLayoutData(textLayoutData);

	text.addKeyListener(new FilterKeyListener());

	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.CENTER).grab(true, false).span(DO_SHOW_DIALOG ? 1 : 2, 1)
			.applyTo(text);

	return text;
}
 
开发者ID:de-jcup,项目名称:eclipse-batch-editor,代码行数:21,代码来源:AbstractFilterableTreeQuickDialog.java

示例8: createControl

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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.GridDataFactory; //导入依赖的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.GridDataFactory; //导入依赖的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: createDialogArea

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
       Composite container = (Composite) super.createDialogArea(parent);
       GridLayout layout = new GridLayout(3, false);
       layout.marginRight = 5;
       layout.marginLeft = 10;
       container.setLayout(layout);
       
       
       Label lblProperties = new Label(container, SWT.NONE);
       lblProperties.setText("Properties:");
       GridDataFactory.swtDefaults().align(SWT.BEGINNING, SWT.BEGINNING).applyTo(lblProperties);
       
       
       withContext = new Button(container, SWT.CHECK); 
       withContext.setText("Store term contexts to the exported file");
       withContext.setSelection(jsonOptions.isWithContexts());
       GridDataFactory.swtDefaults().span(3, 1).applyTo(withContext);

       withOccurrences = new Button(container, SWT.CHECK); 
       withOccurrences.setText("Store term occurrences to the exported file");
       withOccurrences.setSelection(jsonOptions.isEmbeddedOccurrences());
       GridDataFactory.swtDefaults().span(3, 1).applyTo(withOccurrences);

       return container;
}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:27,代码来源:JSONOptionsDialog.java

示例12: createControls

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的package包/类
@PostConstruct
public void createControls(Composite parent) {
	final Composite comp = new Composite(parent, SWT.NONE);
	comp.setLayout(new GridLayout());
	final DelayableText text = new DelayableText(DELAY, comp, SWT.SEARCH | SWT.ICON_SEARCH | SWT.CANCEL | SWT.BORDER);
	text.setMessage("Search");
	GridDataFactory.fillDefaults().hint(130, SWT.DEFAULT).applyTo(text);
	text.addDelayedModificationListener(new DelayedModificationListener() {
			
		@Override
		public void modifyText(final EventObject e) {
			sync.asyncExec(new Runnable() {
				@Override
				public void run() {
					eventBroker.post(TermSuiteEvents.SEARCH_TEXT_MODIFIED, ((DelayableText)e.getSource()).getText());
				}
			});

		}
	});

}
 
开发者ID:termsuite,项目名称:termsuite-ui,代码行数:23,代码来源:SearchToolItem.java

示例13: createContents

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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

示例14: createControl

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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

示例15: createDialogArea

import org.eclipse.jface.layout.GridDataFactory; //导入依赖的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


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