本文整理汇总了Java中org.eclipse.core.databinding.beans.BeanProperties.values方法的典型用法代码示例。如果您正苦于以下问题:Java BeanProperties.values方法的具体用法?Java BeanProperties.values怎么用?Java BeanProperties.values使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.core.databinding.beans.BeanProperties
的用法示例。
在下文中一共展示了BeanProperties.values方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createUniverseTable
import org.eclipse.core.databinding.beans.BeanProperties; //导入方法依赖的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;
}
示例2: bindProjectPreviewTable
import org.eclipse.core.databinding.beans.BeanProperties; //导入方法依赖的package包/类
private void bindProjectPreviewTable() {
IObservableSet observableVersioningProjects = BeansObservables.observeSet(editVersionModel, EditVersionModel.PN_PROJECTS);
IBeanValueProperty[] labelProperties = BeanProperties.values(new String[] { VersioningProject.PN_PROJECT_ID, VersioningProject.PN_OLD_VERSION, VersioningProject.PN_NEW_VERSION });
ObservableSetContentProvider contentProvider = new ObservableSetContentProvider();
projectPreviewTable.setContentProvider(contentProvider);
projectPreviewTable.setLabelProvider(new TableLabelProvider(projectPreviewTable.getTable().getDisplay(), Properties.observeEach(contentProvider.getKnownElements(), labelProperties)));
projectPreviewTable.setInput(observableVersioningProjects);
projectPreviewTable.setCheckStateProvider(new ObservableCheckStateProvider<CheckboxTableViewer>(projectPreviewTable, observableVersioningProjects,
BeanProperties.value(VersioningProject.PN_SELECTED)));
}
示例3: createFilesGroup
import org.eclipse.core.databinding.beans.BeanProperties; //导入方法依赖的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;
}
示例4: createFilesGroup
import org.eclipse.core.databinding.beans.BeanProperties; //导入方法依赖的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;
}