本文整理汇总了Java中org.eclipse.core.databinding.beans.PojoProperties类的典型用法代码示例。如果您正苦于以下问题:Java PojoProperties类的具体用法?Java PojoProperties怎么用?Java PojoProperties使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
PojoProperties类属于org.eclipse.core.databinding.beans包,在下文中一共展示了PojoProperties类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createControl
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
@SuppressWarnings("unchecked")
@Override
public void createControl(Composite parent) {
Composite listComposite = new Composite(parent, NONE);
listComposite.setLayout(new FillLayout());
ListViewer projectListViewer = new ListViewer(listComposite, SWT.BORDER | SWT.MULTI);
projectListViewer.setContentProvider(ArrayContentProvider.getInstance());
projectListViewer.setInput(getNonTestProjects());
// Data binding
DataBindingContext databindingContext = new DataBindingContext();
parent.addDisposeListener(e -> databindingContext.dispose());
databindingContext.bindList(ViewersObservables.observeMultiSelection(projectListViewer),
PojoProperties.list(N4MFProjectInfo.class, N4MFProjectInfo.TESTED_PROJECT_PROP_NAME)
.observe(projectInfo));
setControl(listComposite);
}
示例2: setupProjectSelectorDataBinding
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
private void setupProjectSelectorDataBinding() {
IViewerObservableValue projectInput =
ViewerProperties.input().observe(projectSelector.getViewer());
IViewerObservableValue projectSelection =
ViewerProperties.singleSelection().observe(projectSelector.getViewer());
bindingContext.addValidationStatusProvider(
new ProjectSelectionValidator(projectInput, projectSelection, requireValues));
IViewerObservableValue projectList =
ViewerProperties.singleSelection().observe(projectSelector.getViewer());
IObservableValue projectIdModel = PojoProperties.value("projectId").observe(model);
UpdateValueStrategy gcpProjectToProjectId =
new UpdateValueStrategy().setConverter(new GcpProjectToProjectIdConverter());
UpdateValueStrategy projectIdToGcpProject =
new UpdateValueStrategy().setConverter(new ProjectIdToGcpProjectConverter());
bindingContext.bindValue(projectList, projectIdModel,
gcpProjectToProjectId, projectIdToGcpProject);
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:21,代码来源:AppEngineDeployPreferencesPanel.java
示例3: ProjectSelector
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的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);
}
示例4: addDataBinder
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
private void addDataBinder(Widget toObserve, IValidator validator, Class<?> observableClass,
String propertyName, Object observedProperty, boolean textDecorationEnabled) {
IObservableValue textObservable = WidgetProperties.text(SWT.Modify).observe(toObserve);
UpdateValueStrategy strategy = new UpdateValueStrategy();
strategy.setBeforeSetValidator(validator);
ValidationStatusProvider binding = this.ctx.bindValue(textObservable,
PojoProperties.value(observableClass, propertyName).observe(observedProperty), strategy,
null);
if (textDecorationEnabled) {
ControlDecorationSupport.create(binding, SWT.LEFT);
}
final IObservableValue errorObservable = WidgetProperties.text()
.observe(this.addDialog.getErrorLabel());
ctx.bindValue(errorObservable, new AggregateValidationStatus(ctx.getBindings(),
AggregateValidationStatus.MAX_SEVERITY),
null, null);
}
示例5: initDataBindings
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
protected DataBindingContext initDataBindings(){
DataBindingContext bindingContext = new DataBindingContext();
//
IObservableValue observeTextTxti18nObserveWidget =
WidgetProperties.text(SWT.Modify).observe(txti18n);
IObservableValue wvTranslatedLabelObserveDetailValue =
PojoProperties.value(Role.class, "translatedLabel", String.class).observeDetail(wv);
bindingContext.bindValue(observeTextTxti18nObserveWidget,
wvTranslatedLabelObserveDetailValue, null, null);
//
IObservableValue observeEnabledTxtRoleNameObserveWidget =
WidgetProperties.enabled().observe(txtRoleName);
IObservableValue wvSystemRoleObserveDetailValue =
PojoProperties.value(Role.class, "systemRole", Boolean.class).observeDetail(wv);
UpdateValueStrategy strategy = new UpdateValueStrategy();
strategy.setConverter(new BooleanNotConverter());
bindingContext.bindValue(observeEnabledTxtRoleNameObserveWidget,
wvSystemRoleObserveDetailValue,
new UpdateValueStrategy(UpdateValueStrategy.POLICY_NEVER), strategy);
//
return bindingContext;
}
示例6: initTestProjectBinding
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private void initTestProjectBinding(DataBindingContext dbc, Button addNormalSourceFolderButton,
Button createTestGreeterFileButton) {
// Bind the "normal source folder"-checkbox
dbc.bindValue(WidgetProperties.selection().observe(addNormalSourceFolderButton),
PojoProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.ADDITIONAL_NORMAL_SOURCE_FOLDER_PROP_NAME)
.observe(projectInfo));
// Bind the "Create greeter file"-checkbox
dbc.bindValue(WidgetProperties.selection().observe(createTestGreeterFileButton),
BeanProperties.value(N4MFProjectInfo.class, N4MFProjectInfo.CREATE_GREETER_FILE_PROP_NAME)
.observe(projectInfo));
}
示例7: createPart
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的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 () );
}
示例8: createInput
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
@Override
protected void createInput ( final DataBindingContext dbc, final Label label, final Composite composite )
{
this.input = new Text ( composite, SWT.BORDER );
this.input.setLayoutData ( new GridData ( SWT.FILL, SWT.CENTER, true, false ) );
dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( this.input ), PojoProperties.value ( TextCallback.PROP_VALUE ).observe ( this.callback ) );
}
示例9: getLabel
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
@Override
public String getLabel ()
{
try
{
return (String)PojoProperties.value ( "hiveId" ).getValue ( this.hive );
}
catch ( final Exception e )
{
}
return this.hive.toString ();
}
示例10: initDataBindings
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
IObservableValue observeTextTxtUserNameObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtUserName);
IObservableValue userNameCredentialsObserveValue = PojoProperties.value("username").observe(credentials);
bindingContext.bindValue(observeTextTxtUserNameObserveWidget, userNameCredentialsObserveValue, null, null);
//
IObservableValue observeTextTxtPasswordObserveWidget = WidgetProperties.text(SWT.Modify).observe(txtPassword);
IObservableValue passwordCredentialsObserveValue = PojoProperties.value("password").observe(credentials);
bindingContext.bindValue(observeTextTxtPasswordObserveWidget, passwordCredentialsObserveValue, null, null);
//
return bindingContext;
}
示例11: setupAccountEmailDataBinding
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
private void setupAccountEmailDataBinding() {
AccountSelectorObservableValue accountSelectorObservableValue =
new AccountSelectorObservableValue(accountSelector);
UpdateValueStrategy modelToTarget =
new UpdateValueStrategy().setConverter(new Converter(String.class, String.class) {
@Override
public Object convert(Object savedEmail) {
Preconditions.checkArgument(savedEmail instanceof String);
if (accountSelector.isEmailAvailable((String) savedEmail)) {
return savedEmail;
} else if (requireValues && accountSelector.getAccountCount() == 1) {
return accountSelector.getFirstEmail();
} else {
return null;
}
}
});
final IObservableValue accountEmailModel = PojoProperties.value("accountEmail").observe(model);
Binding binding = bindingContext.bindValue(accountSelectorObservableValue, accountEmailModel,
new UpdateValueStrategy(), modelToTarget);
/*
* Trigger an explicit target -> model update for the auto-select-single-account case. When the
* model has a null account but there is exactly 1 login account, then the AccountSelector
* automatically selects that account. That change means the AccountSelector is at odds with the
* model.
*/
binding.updateTargetToModel();
bindingContext.addValidationStatusProvider(new AccountSelectorValidator(
requireValues, accountSelector, accountSelectorObservableValue));
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:33,代码来源:AppEngineDeployPreferencesPanel.java
示例12: setupPossiblyUnvalidatedTextFieldDataBinding
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
/**
* Binds a {@link Text} field with a property of the {@link DeployPreferences deploy
* preferences model} given to the panel. This method honors the panel's validation mode (set
* through the {@code requireValues} parameter when this panel was instantiated) such that {@code
* validator} is ignored if {@code requireValues} is {@code false}.
*
* @see #AppEngineDeployPreferencesPanel
*/
protected void setupPossiblyUnvalidatedTextFieldDataBinding(Text text, String modelPropertyName,
ValidationStatusProvider validator) {
ISWTObservableValue textValue = WidgetProperties.text(SWT.Modify).observe(text);
IObservableValue modelValue = PojoProperties.value(modelPropertyName).observe(model);
bindingContext.bindValue(textValue, modelValue);
if (requireValues) {
bindingContext.addValidationStatusProvider(validator);
}
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:19,代码来源:AppEngineDeployPreferencesPanel.java
示例13: setupTextFieldDataBinding
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
/**
* Binds a {@link Text} field with a property of the {@link DeployPreferences deploy
* preferences model} given to the panel.
*
* Unlike {@link #setupFileFieldDataBinding}, {@code setAfterGetValidator} is always enforced
* regardless of the panel's validation mode.
*
* @see #setupTextFieldDataBinding
*/
private void setupTextFieldDataBinding(Text text, String modelPropertyName,
IValidator afterGetValidator) {
ISWTObservableValue textValue = WidgetProperties.text(SWT.Modify).observe(text);
IObservableValue modelValue = PojoProperties.value(modelPropertyName).observe(model);
bindingContext.bindValue(textValue, modelValue,
new UpdateValueStrategy().setAfterGetValidator(afterGetValidator),
new UpdateValueStrategy().setAfterGetValidator(afterGetValidator));
}
开发者ID:GoogleCloudPlatform,项目名称:google-cloud-eclipse,代码行数:19,代码来源:AppEngineDeployPreferencesPanel.java
示例14: initDataBindings
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
/**
* initializing the data bindings for the UI.
*
* @return The prepared context to be bound to the ui.
*/
public DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
SPLevoProject splevoProject = getSPLevoProject();
MarkDirtyListener markDirtyListener = new MarkDirtyListener(getSplevoProjectEditor());
//
IObservableValue observeTextInputVariantNameLeadingObserveWidget = WidgetProperties.text(SWT.Modify).observe(
inputVariantNameLeading);
IObservableValue variantNameLeadingGetSplevoProjectObserveValue = PojoProperties.value("variantNameLeading")
.observe(splevoProject);
variantNameLeadingGetSplevoProjectObserveValue.addChangeListener(markDirtyListener);
bindingContext.bindValue(observeTextInputVariantNameLeadingObserveWidget,
variantNameLeadingGetSplevoProjectObserveValue, null, null);
//
IObservableValue observeTextInputVariantNameIntegrationObserveWidget = WidgetProperties.text(SWT.Modify)
.observe(inputVariantNameIntegration);
IObservableValue variantNameIntegrationGetSplevoProjectObserveValue = PojoProperties.value(
"variantNameIntegration").observe(splevoProject);
variantNameIntegrationGetSplevoProjectObserveValue.addChangeListener(markDirtyListener);
bindingContext.bindValue(observeTextInputVariantNameIntegrationObserveWidget,
variantNameIntegrationGetSplevoProjectObserveValue, null, null);
//
return bindingContext;
}
示例15: initDataBindings
import org.eclipse.core.databinding.beans.PojoProperties; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap observeMap = BeansObservables.observeMap(listContentProvider.getKnownElements(), IEditorInputResource.class, "name");
listViewer.setLabelProvider(new ObservableMapLabelProvider(observeMap));
listViewer.setContentProvider(listContentProvider);
//
IObservableList resourcesResourceProviderObserveList = PojoProperties.list("resources").observe(resourceProvider);
listViewer.setInput(resourcesResourceProviderObserveList);
//
return bindingContext;
}