• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ViewerSupport类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: ProjectSelector

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
public ProjectSelector(Composite parent) {
  super(parent, SWT.NONE);
  GridLayoutFactory.fillDefaults().numColumns(2).spacing(0, 0).applyTo(this);

  Composite tableComposite = new Composite(this, SWT.NONE);
  TableColumnLayout tableColumnLayout = new TableColumnLayout();
  tableComposite.setLayout(tableColumnLayout);
  GridDataFactory.fillDefaults().grab(true, true).applyTo(tableComposite);
  viewer = new TableViewer(tableComposite, SWT.SINGLE | SWT.BORDER | SWT.FULL_SELECTION);
  createColumns(tableColumnLayout);
  viewer.getTable().setHeaderVisible(true);
  viewer.getTable().setLinesVisible(false);

  input = WritableList.withElementType(GcpProject.class);
  projectProperties = PojoProperties.values(new String[] {"name", "id"}); //$NON-NLS-1$ //$NON-NLS-2$
  ViewerSupport.bind(viewer, input, projectProperties);
  viewer.setComparator(new ViewerComparator());

  Composite linkComposite = new Composite(this, SWT.NONE);
  statusLink = new Link(linkComposite, SWT.WRAP);
  statusLink.addSelectionListener(
      new OpenUriSelectionListener(new ErrorDialogErrorHandler(getShell())));
  statusLink.setText("");
  GridDataFactory.fillDefaults().span(2, 1).applyTo(linkComposite);
  GridLayoutFactory.fillDefaults().generateLayout(linkComposite);
}
 
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:27,代码来源:ProjectSelector.java


示例2: createDialogArea

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
	Composite area = (Composite) super.createDialogArea(parent);
	
	TableViewer tableViewer = new TableViewer(area, SWT.BORDER | SWT.FULL_SELECTION);
	table = tableViewer.getTable();
	table.setLinesVisible(true);
	table.setHeaderVisible(true);
	table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
	
	TableColumn tblColumnDate = new TableColumn(table, SWT.NONE);
	tblColumnDate.setWidth(150);
	tblColumnDate.setText("Date");
	
	TableColumn tblColumnMsg = new TableColumn(table, SWT.NONE);
	tblColumnMsg.setWidth(300);
	tblColumnMsg.setText("Message");
	
	ViewerSupport.bind(tableViewer, hub.getLog(), BeanProperties.values(new String[] {"date", "msg"}));
			
	setHelpAvailable(false);
	setTitle(hub.getName());
	setMessage(hub.getAddress());

	return area;
}
 
开发者ID:fp7-netide,项目名称:IDE,代码行数:27,代码来源:ZmqLogDialog.java


示例3: addSshComboDataBinding

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
private void addSshComboDataBinding(ArrayList<SshProfileModel> profileList) {

		// bind sshmodellist to combobox content
		WritableList input = new WritableList(profileList, SshProfileModel.class);
		this.statusModel.setWritableProfileList(input);

		ComboViewer cv = this.editor.getSshComboViewer();
		ViewerSupport.bind(cv, input, BeanProperties.values(new String[] { Constants.PROFILE_NAME_MODEL }));

		// bind selectionIndex to model
		// selectionIndex == profileListIndex, use it to match selection to
		// actual model
		IObservableValue selection = WidgetProperties.singleSelectionIndex().observe(cv.getCombo());
		IObservableValue modelValue = BeanProperties.value(UiStatusModel.class, Constants.SSH_COMBO_SELECTION_INDEX)
				.observe(this.statusModel);

		if (!input.isEmpty())
			cv.getCombo().select(0);

		this.ctx.bindValue(modelValue, selection);
	}
 
开发者ID:fp7-netide,项目名称:IDE,代码行数:22,代码来源:WorkbenchConfigurationEditorEngine.java


示例4: addTableDataBinding

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
private void addTableDataBinding(ArrayList<LaunchConfigurationModel> modelList) {
	WritableList input = new WritableList(modelList, LaunchConfigurationModel.class);

	this.statusModel.setWritableModelList(input);
	ViewerSupport
			.bind(this.editor.getTableViewer(), input,
					BeanProperties.values(new String[] { Constants.LaunchName, Constants.APP_NAME_MODEL,
							Constants.APP_RUNNING_MODEL, Constants.PLATFORM_MODEL,
							Constants.CLIENT_CONTROLLER_MODEL, Constants.PORT_MODEL, Constants.FLAG_BACKEND, Constants.FLAG_APP }));

	// bind selectionIndex to model
	// selectionIndex == profileListIndex, use it to match selection to
	// actual model
	IObservableValue selection = WidgetProperties.singleSelectionIndex()
			.observe(this.editor.getTableViewer().getTable());
	IObservableValue modelValue = BeanProperties.value(UiStatusModel.class, Constants.LAUNCH_TABLE_INDEX)
			.observe(this.statusModel);

	this.ctx.bindValue(modelValue, selection);

}
 
开发者ID:fp7-netide,项目名称:IDE,代码行数:22,代码来源:WorkbenchConfigurationEditorEngine.java


示例5: createPart

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
@Override
public void createPart ( final Composite parent )
{
    super.createPart ( parent );

    this.viewer = new TableViewer ( parent, SWT.FULL_SELECTION );

    final TableLayout tableLayout = new TableLayout ();

    final TableViewerColumn col1 = new TableViewerColumn ( this.viewer, SWT.NONE );
    col1.getColumn ().setText ( Messages.AttributesPart_NameLabel );
    tableLayout.addColumnData ( new ColumnWeightData ( 50 ) );

    final TableViewerColumn col2 = new TableViewerColumn ( this.viewer, SWT.NONE );
    col2.getColumn ().setText ( Messages.AttributesPart_TypeLabel );
    tableLayout.addColumnData ( new ColumnWeightData ( 20 ) );

    final TableViewerColumn col3 = new TableViewerColumn ( this.viewer, SWT.NONE );
    col3.getColumn ().setText ( Messages.AttributesPart_ValueLabel );
    tableLayout.addColumnData ( new ColumnWeightData ( 50 ) );

    this.viewer.getTable ().setHeaderVisible ( true );
    this.viewer.getTable ().setLayout ( tableLayout );

    ViewerSupport.bind ( this.viewer, this.entries, new IValueProperty[] { PojoProperties.value ( "name" ), PojoProperties.value ( "type" ), PojoProperties.value ( "value" ) } ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    this.viewer.setComparator ( new ViewerComparator () );
}
 
开发者ID:eclipse,项目名称:neoscada,代码行数:29,代码来源:AttributesPart.java


示例6: initDataBindings

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
/**
 * 初始化数据绑定 将界面与<code>currServer</code>进行绑定
 * @return ;
 */
protected void initDataBindings() {
	DataBindingContext bindingContext = new DataBindingContext();

	IObservableValue widgetValue = WidgetProperties.text(SWT.Modify).observe(instanceText);
	final IObservableValue instanceModelValue = BeanProperties.value("instance").observe(currServer);
	bindingContext.bindValue(widgetValue, instanceModelValue, null, null);

	widgetValue = WidgetProperties.text(SWT.Modify).observe(hostText);
	final IObservableValue hostModelValue = BeanProperties.value("host").observe(currServer);
	bindingContext.bindValue(widgetValue, hostModelValue, null, null);

	widgetValue = WidgetProperties.text(SWT.Modify).observe(portText);
	final IObservableValue protModelValue = BeanProperties.value("port").observe(currServer);
	bindingContext.bindValue(widgetValue, protModelValue, null, null);

	widgetValue = WidgetProperties.text(SWT.Modify).observe(locationText);
	final IObservableValue locationModelValue = BeanProperties.value("itlDBLocation").observe(currServer);
	bindingContext.bindValue(widgetValue, locationModelValue, null, null);

	widgetValue = WidgetProperties.text(SWT.Modify).observe(usernameText);
	final IObservableValue usernameModelValue = BeanProperties.value("userName").observe(currServer);
	bindingContext.bindValue(widgetValue, usernameModelValue, null, null);

	widgetValue = WidgetProperties.text(SWT.Modify).observe(passwordText);
	final IObservableValue passwordModelValue = BeanProperties.value("password").observe(currServer);
	bindingContext.bindValue(widgetValue, passwordModelValue, null, null);

	ViewerSupport.bind(dbTableViewer, currServerdbListInput,
			BeanProperties.values(new String[] { "index", "dbName", "langs" }));

}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:36,代码来源:TermDbManagerDialog.java


示例7: createUniverseTable

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
private TableViewer createUniverseTable(Composite parent) {
	TableViewer tableViewer = new TableViewer(parent, SWT.NONE);
	Table table = tableViewer.getTable();
	table.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
	table.setHeaderVisible(true);
	table.setLinesVisible(true);

	TableViewerColumn nameCol = new TableViewerColumn(tableViewer, SWT.NONE);
	nameCol.getColumn().setWidth(200);
	nameCol.getColumn().setText(Messages.projectUniverseNamePropertyLabel);

	TableViewerColumn locationCol = new TableViewerColumn(tableViewer, SWT.NONE);
	locationCol.getColumn().setWidth(400);
	locationCol.getColumn().setText(Messages.projectUniverseFilePropertyLabel);

	tableViewer.setSorter(new ViewerSorter());

	IObservableSet input = BeansObservables.observeSet(universeDefinitionsModel, UniverseDefinitionsModel.PN_UNIVERSE_FILES);
	IValueProperty[] labelProperties = BeanProperties.values(new String[] { UniverseFile.PN_NAME, UniverseFile.PN_LOCATION });
	ViewerSupport.bind(tableViewer, input, labelProperties);

	return tableViewer;
}
 
开发者ID:inventage,项目名称:version-tiger,代码行数:24,代码来源:VersioningPreferencePage.java


示例8: createFilesGroup

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
/**
 * 创建文件列表区域
 * @param contents
 *            ;
 */
private Composite createFilesGroup(Composite contents) {
	Composite filesComposite = new Composite(contents, SWT.NONE);
	filesComposite.setLayout(new GridLayout(1, false));
	filesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));

	filesTable = new Table(filesComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI
			| SWT.FULL_SELECTION);

	GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
	tableData.heightHint = 100;
	filesTable.setLayoutData(tableData);
	filesTable.setLinesVisible(true);
	filesTable.setHeaderVisible(true);

	filesTable.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			TableItem[] selected = filesTable.getSelection();
			if (selected.length == 0) {
				return;
			}

			String strTgtEnc = ""; //$NON-NLS-1$

			for (int i = 0; i < selected.length; i++) {
				String curTgtEnc = selected[i].getText(2);
				if (i == 0) {
					strTgtEnc = curTgtEnc;
				} else {
					if (!strTgtEnc.equals(curTgtEnc)) {
						strTgtEnc = ""; //$NON-NLS-1$
						break;
					}
				}
			}

			if (!"".equals(strTgtEnc)) { //$NON-NLS-1$
				tgtEncCombo.setText(strTgtEnc);
			} else {
				tgtEncCombo.deselectAll();
			}
		}
	});
	tableViewer = new TableViewer(filesTable);

	lineNumberColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	lineNumberColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.lineNumberColumn"));
	
	xliffColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	xliffColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.xliffColumn")); //$NON-NLS-1$

	tgtEncColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	tgtEncColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.tgtEncColumn")); //$NON-NLS-1$

	targetColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	targetColumn.setText(Messages.getString("wizard.ReverseConversionWizardPage.targetColumn")); //$NON-NLS-1$

	IValueProperty[] valueProperties = BeanProperties.values(ConversionConfigBean.class, new String[] {
			"index","source", "targetEncoding", "target" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	ViewerSupport.bind(tableViewer, new WritableList(conversionConfigBeans, ConversionConfigBean.class),
			valueProperties);

	filesComposite.addPaintListener(new PaintListener() {
		public void paintControl(PaintEvent arg0) {
			int width = filesTable.getClientArea().width;
			lineNumberColumn.setWidth(width * 1 / 10);
			targetColumn.setWidth(width * 4 / 10);
			tgtEncColumn.setWidth(width * 1 / 10);
			xliffColumn.setWidth(width * 4 / 10);
		}
	});
	return filesComposite;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:79,代码来源:ReverseConversionWizardPage.java


示例9: createFilesGroup

import org.eclipse.jface.databinding.viewers.ViewerSupport; //导入依赖的package包/类
/**
 * 创建文件列表区域
 * @param contents
 *            ;
 */
private Composite createFilesGroup(Composite contents) {
	Composite filesComposite = new Composite(contents, SWT.NONE);
	filesComposite.setLayout(new GridLayout(1, false));
	filesComposite.setLayoutData(new GridData(GridData.FILL_BOTH));

	filesTable = new Table(filesComposite, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL | SWT.MULTI
			| SWT.FULL_SELECTION);

	GridData tableData = new GridData(GridData.GRAB_HORIZONTAL | GridData.GRAB_VERTICAL | GridData.FILL_BOTH);
	tableData.heightHint = 100;
	filesTable.setLayoutData(tableData);
	filesTable.setLinesVisible(true);
	filesTable.setHeaderVisible(true);

	filesTable.addSelectionListener(new SelectionAdapter() {
		@Override
		public void widgetSelected(SelectionEvent e) {
			TableItem[] selected = filesTable.getSelection();
			if (selected.length == 0) {
				return;
			}

			String strTgtEnc = ""; //$NON-NLS-1$

			for (int i = 0; i < selected.length; i++) {
				String curTgtEnc = selected[i].getText(1);
				if (i == 0) {
					strTgtEnc = curTgtEnc;
				} else {
					if (!strTgtEnc.equals(curTgtEnc)) {
						strTgtEnc = ""; //$NON-NLS-1$
						break;
					}
				}
			}

			if (!"".equals(strTgtEnc)) { //$NON-NLS-1$
				tgtEncCombo.setText(strTgtEnc);
			} else {
				tgtEncCombo.deselectAll();
			}
		}
	});
	tableViewer = new TableViewer(filesTable);

	xliffColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	xliffColumn.setText("XLIFF 文件"); //$NON-NLS-1$

	tgtEncColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	tgtEncColumn.setText("目标编码"); //$NON-NLS-1$

	targetColumn = new TableViewerColumn(tableViewer, SWT.NONE).getColumn();
	targetColumn.setText("目标文件"); //$NON-NLS-1$

	IValueProperty[] valueProperties = BeanProperties.values(ConversionConfigBean.class, new String[] {
			"source", "targetEncoding", "target" }); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
	ViewerSupport.bind(tableViewer, new WritableList(conversionConfigBeans, ConversionConfigBean.class),
			valueProperties);

	filesComposite.addPaintListener(new PaintListener() {
		public void paintControl(PaintEvent arg0) {
			int width = filesTable.getClientArea().width;
			targetColumn.setWidth(width * 4 / 10);
			tgtEncColumn.setWidth(width * 2 / 10);
			xliffColumn.setWidth(width * 4 / 10);
		}
	});
	return filesComposite;
}
 
开发者ID:heartsome,项目名称:translationstudio8,代码行数:75,代码来源:ReverseConversionWizardPage.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java ShardIteratorType类代码示例发布时间:2022-05-22
下一篇:
Java MAC类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap