本文整理汇总了Java中org.eclipse.core.databinding.observable.masterdetail.IObservableFactory类的典型用法代码示例。如果您正苦于以下问题:Java IObservableFactory类的具体用法?Java IObservableFactory怎么用?Java IObservableFactory使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IObservableFactory类属于org.eclipse.core.databinding.observable.masterdetail包,在下文中一共展示了IObservableFactory类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: observe
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; //导入依赖的package包/类
private IObservable observe(Object dataContext, String path) {
if (dataContext instanceof IObservableValue) {
IObservableValue observableValue = (IObservableValue) dataContext;
IObservableFactory factory = target -> {
return observe(target, path);
};
@SuppressWarnings("restriction")
IObservableValue detailValue = new DetailObservableValue(observableValue, factory, null) {
@Override
public Object getValueType() {
try {
IObservableValue innerObservableValue = (IObservableValue) innerObservableValueField.get(this);
if (innerObservableValue != null) {
return innerObservableValue.getValueType();
}
} catch (IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return super.getValueType();
}
};
return detailValue;
}
IObservable ret = null;
String[] paths = path.split(".");
return ret == null ? observeProperty(dataContext, path) : ret;
}
开发者ID:erdalkaraca,项目名称:lambda-ui,代码行数:33,代码来源:Binder.java
示例2: getObservableListFactory
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; //导入依赖的package包/类
/**
* Gets the observable list factory.
*
* @return the observable list factory
*/
private static IObservableFactory getObservableListFactory() {
return new IObservableFactory() {
public IObservable createObservable(Object parent) {
if (parent instanceof IParentNode) {
return ((IParentNode) parent).getObservableChildren();
}
return null;
}
};
}
开发者ID:synergynet,项目名称:synergyview,代码行数:16,代码来源:NavigatorContentProvider.java
示例3: createPart
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; //导入依赖的package包/类
@Override
public void createPart ( final Composite parent )
{
super.createPart ( parent );
this.viewer = new TreeViewer ( parent );
final IObservableFactory factory = new IObservableFactory () {
@Override
public IObservable createObservable ( final Object target )
{
if ( target instanceof IObservable )
{
return (IObservable)target;
}
else if ( target instanceof GroupEntry )
{
return ( (GroupEntry)target ).getEntries ();
}
return null;
}
};
final ObservableSetTreeContentProvider contentProvider = new ObservableSetTreeContentProvider ( factory, null );
this.viewer.setContentProvider ( contentProvider );
final TableLayout tableLayout = new TableLayout ();
this.col1 = new TreeViewerColumn ( this.viewer, SWT.NONE );
this.col1.getColumn ().setText ( Messages.FlagsDetailsPart_ColFlagLabel );
tableLayout.addColumnData ( new ColumnWeightData ( 100 ) );
this.col1.setLabelProvider ( new ColumnLabelLabelProvider ( contentProvider.getRealizedElements () ) );
this.col2 = new TreeViewerColumn ( this.viewer, SWT.NONE );
this.col2.getColumn ().setText ( Messages.FlagsDetailsPart_ColStateLabel );
tableLayout.addColumnData ( new ColumnWeightData ( 100 ) );
this.col2.setLabelProvider ( new ColumnLabelStateProvider ( contentProvider.getRealizedElements () ) );
this.viewer.getTree ().setHeaderVisible ( true );
this.viewer.getTree ().setLayout ( tableLayout );
this.viewer.setUseHashlookup ( true );
this.viewer.setInput ( this.groupSet );
this.groupSet.add ( new GroupEntry ( "error", Messages.FlagsDetailsPart_GroupErrorLabel ) ); //$NON-NLS-1$
this.groupSet.add ( new GroupEntry ( "alarm", Messages.FlagsDetailsPart_GroupAlarmLabel ) ); //$NON-NLS-1$
this.groupSet.add ( new GroupEntry ( "warning", Messages.FlagsDetailsPart_GroupWarningLabel ) ); //$NON-NLS-1$
this.groupSet.add ( new GroupEntry ( "blocked", Messages.FlagsDetailsPart_GroupBlockingLabel ) ); //$NON-NLS-1$
this.groupSet.add ( new GroupEntry ( "ackRequired", Messages.FlagsDetailsPart_GroupAknLabel ) ); //$NON-NLS-1$
this.groupSet.add ( new GroupEntry ( "manual", Messages.FlagsDetailsPart_ManualLabel ) ); //$NON-NLS-1$
}
开发者ID:eclipse,项目名称:neoscada,代码行数:54,代码来源:FlagsDetailsPart.java
示例4: createDataModel
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; //导入依赖的package包/类
protected void createDataModel ( final TreeViewer viewer )
{
final DataBindingContext dbc = new DataBindingContext ();
final IObservableFactory listFactory = new IObservableFactory () {
@Override
public IObservable createObservable ( final Object target )
{
if ( target instanceof IObservableList )
{
return (IObservableList)target;
}
else if ( target instanceof World )
{
return EMFObservables.observeList ( (EObject)target, InfrastructurePackage.Literals.WORLD__NODES );
}
else if ( target instanceof SystemNode )
{
return EMFObservables.observeList ( (EObject)target, InfrastructurePackage.Literals.SYSTEM_NODE__DRIVERS );
}
return null;
}
};
final AdapterFactory adapterFactory = new InfrastructureItemProviderAdapterFactory ();
final AdapterFactoryLabelProvider labelProvider = new AdapterFactoryLabelProvider ( adapterFactory );
final ObservableListTreeContentProvider cp = new ObservableListTreeContentProvider ( listFactory, null );
viewer.setContentProvider ( cp );
viewer.setLabelProvider ( labelProvider );
viewer.setInput ( EMFObservables.observeList ( this.world, InfrastructurePackage.Literals.WORLD__NODES ) );
dbc.bindValue ( ViewersObservables.observeSingleSelection ( viewer ), this.driverValue );
this.driverValue.addValueChangeListener ( new IValueChangeListener () {
@Override
public void handleValueChange ( final ValueChangeEvent event )
{
update ();
}
} );
viewer.getControl ().addDisposeListener ( new DisposeListener () {
@Override
public void widgetDisposed ( final DisposeEvent e )
{
dbc.dispose ();
}
} );
}
开发者ID:eclipse,项目名称:neoscada,代码行数:55,代码来源:DriverSelectionDialog.java
示例5: BTSConfigurationTreeContentProvider
import org.eclipse.core.databinding.observable.masterdetail.IObservableFactory; //导入依赖的package包/类
public BTSConfigurationTreeContentProvider(IObservableFactory listFactory, TreeStructureAdvisor structureAdvisor)
{
super(listFactory, structureAdvisor);
// TODO Auto-generated constructor stub
}
开发者ID:cplutte,项目名称:bts,代码行数:6,代码来源:BTSConfigurationTreeContentProvider.java
注:本文中的org.eclipse.core.databinding.observable.masterdetail.IObservableFactory类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论