本文整理汇总了Java中org.eclipse.core.databinding.observable.map.IObservableMap类的典型用法代码示例。如果您正苦于以下问题:Java IObservableMap类的具体用法?Java IObservableMap怎么用?Java IObservableMap使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
IObservableMap类属于org.eclipse.core.databinding.observable.map包,在下文中一共展示了IObservableMap类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createStandardCombo
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
public void createStandardCombo ( final Composite parent, final String attributeName, final String label, final String[] items, final IObservableMap data, final Object valueType )
{
this.toolkit.createLabel ( parent, label + ":" );
final Combo combo = new Combo ( parent, SWT.DROP_DOWN );
combo.setItems ( items );
this.toolkit.adapt ( combo );
final GridData gd = new GridData ( GridData.FILL, GridData.BEGINNING, true, true );
gd.horizontalSpan = 2;
combo.setLayoutData ( gd );
final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
this.dbc.bindValue ( WidgetProperties.text ().observe ( combo ), value );
}
示例2: MediaTimeBar
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
/**
* Instantiates a new media time bar.
*
* @param parent
* the parent
* @param style
* the style
* @param mediaMap
* the media map
* @param collectionNode
* the collection node
* @param mediaFolderValue
* the media folder value
*/
public MediaTimeBar(Composite parent, int style, IObservableMap mediaMap, CollectionNode collectionNode, MediaRootNode mediaFolderValue) {
super(parent, style, mediaMap, collectionNode, mediaFolderValue);
this.parent = parent;
this.createControls(parent, (int) this.getDuration());
this.buildIntervals();
this.addDisposeListener(new DisposeListener() {
public void widgetDisposed(DisposeEvent e) {
disposeResources();
}
});
}
示例3: AnnotationsMediaControl
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
/**
* Instantiates a new annotations media control.
*
* @param parent
* the parent
* @param style
* the style
* @param annotationSetNodeValue
* the annotation set node value
* @param mediaMap
* the media map
* @param mediaFolder
* the media folder
*/
public AnnotationsMediaControl(Composite parent, int style, AnnotationSetNode annotationSetNodeValue, IObservableMap mediaMap, MediaRootNode mediaFolder) {
super(parent, style);
logger = Activator.getDefault().getLog();
this.setLayout(new GridLayout(1, false));
annotationSetNode = annotationSetNodeValue;
projectAttributeRootNode = ((ProjectNode) annotationSetNode.getLastParent()).getProjectAttributeRootNode();
collectionMediaList = ((CollectionNode) annotationSetNode.getParent().getParent()).getResource().getCollectionMediaList();
collectionMediaClip = annotationSetNode.getResource().getCollectionMediaClip();
this._mediaMap = mediaMap;
for (CollectionMedia cMedia : collectionMediaList) {
String mediaName = cMedia.getMediaName();
MediaNode mediaNode = mediaFolder.getMediaNode(mediaName);
_mediaMap.put(cMedia, mediaNode.createMediaInstance());
}
initUI();
initData();
setupDND();
}
示例4: initDataBindings
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
protected DataBindingContext initDataBindings() {
DataBindingContext bindingContext = new DataBindingContext();
//
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap[] observeMaps = EMFEditObservables.observeMaps(editingDomain, listContentProvider.getKnownElements(), new EStructuralFeature[]{Literals.ENTITY__NAME});
tableViewer.setLabelProvider(new ObservableMapLabelProvider(observeMaps));
tableViewer.setContentProvider(listContentProvider);
//
IObservableList architectureCloudProvidersObserveList = EMFEditObservables.observeList(Realm.getDefault(), editingDomain, architecture, ArchitecturePackage.Literals.ARCHITECTURE__CLOUD_ENVIRONMENTS);
tableViewer.setInput(architectureCloudProvidersObserveList);
//
IObservableValue observeSingleSelectionTableViewer = ViewerProperties.singleSelection().observe(tableViewer);
IObservableValue cloudProviderCloudProviderModelObserveValue = BeanProperties.value("cloudProvider").observe(cloudProviderModel);
bindingContext.bindValue(observeSingleSelectionTableViewer, cloudProviderCloudProviderModelObserveValue, null, null);
//
return bindingContext;
}
示例5: initPaaS
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
private void initPaaS (Specification specification)
{
List<? extends PlatformServiceDescriptor> paaSDescriptors = null;
if (specification instanceof CloudSpecification)
paaSDescriptors = OverviewHelper.getPaaSRuntimeDescriptors((CloudSpecification)specification);
else if (specification instanceof ServiceSpecification)
paaSDescriptors = OverviewHelper.getPlatformDescriptors((ServiceSpecification)specification, false, true);
ObservableListContentProvider listContentProvider = new ObservableListContentProvider();
IObservableMap observeMap = PojoObservables.observeMap(listContentProvider.getKnownElements(), ProvidedPlatformRuntimeServiceDescriptor.class, "name");
cvPaaS.setLabelProvider(new ObservableMapLabelProvider(observeMap));
cvPaaS.setContentProvider(listContentProvider);
IObservableList selfList = Properties.selfList(CloudSpecification.class).observe(paaSDescriptors);
cvPaaS.setInput(selfList);
// set default selection
if (!paaSDescriptors.isEmpty())
{
final ISelection selection = new StructuredSelection(paaSDescriptors.get(0));
cvPaaS.setSelection(selection);
}
}
示例6: initDataBindings
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
protected DataBindingContext initDataBindings(){
DataBindingContext bindingContext = new DataBindingContext();
tableViewerContacts.setContentProvider(contentProvider);
IObservableMap[] observeMaps =
BeansObservables.observeMaps(contentProvider.getKnownElements(), IContact.class,
new String[] {
"description1", "description2", "mandator", "patient", "user"
});
ILabelDecorator decorator =
PlatformUI.getWorkbench().getDecoratorManager().getLabelDecorator();
tableViewerContacts.setLabelProvider(new TableDecoratingLabelProvider(
new ContactSelectorObservableMapLabelProvider(observeMaps), decorator));
tableViewerContacts.setInput(contactList);
return bindingContext;
}
示例7: TreeNodeLabelProvider
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
public TreeNodeLabelProvider ( final TreeViewer viewer, final IObservableMap... attributeMaps )
{
super ( attributeMaps );
this.viewer = viewer;
this.defaultFont = viewer.getControl ().getFont ();
final FontData[] fds = this.viewer.getControl ().getFont ().getFontData ();
for ( final FontData fd : fds )
{
fd.setStyle ( SWT.ITALIC );
}
this.font = new Font ( this.viewer.getControl ().getDisplay (), fds );
}
示例8: inputChanged
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
@Override
public void inputChanged ( final Viewer viewer, final Object oldInput, final Object newInput )
{
detach ();
this.viewer = (StructuredViewer)viewer;
if ( newInput instanceof IObservableMap )
{
setInput ( (IObservableMap)newInput );
}
}
示例9: setInput
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
private void setInput ( final IObservableMap input )
{
this.input = input;
input.addMapChangeListener ( this.mapListener = new IMapChangeListener () {
@Override
public void handleMapChange ( final MapChangeEvent event )
{
mapChange ( event.diff );
}
} );
}
示例10: KeyPrefixMapObservable
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
protected KeyPrefixMapObservable ( final IObservableMap map, final String keyPrefix, final Object valueType, final boolean removePrefix )
{
super ( map.getRealm (), new HashMap<Object, Object> () );
this.map = map;
this.keyPrefix = keyPrefix;
this.valueType = valueType;
this.removePrefix = removePrefix;
map.addMapChangeListener ( this.changeListener );
map.addStaleListener ( this.staleListener );
map.addDisposeListener ( this.disposeListener );
}
示例11: ObservableMapStyledCellLabelProvider
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
/**
* Creates a new label provider that tracks changes to more than one
* attribute. This constructor should be used by subclasses that override
* {@link #update(ViewerCell)} and make use of more than one attribute.
*
* @param attributeMaps
*/
protected ObservableMapStyledCellLabelProvider ( final IObservableMap[] attributeMaps )
{
System.arraycopy ( attributeMaps, 0, this.attributeMaps = new IObservableMap[attributeMaps.length], 0, attributeMaps.length );
for ( int i = 0; i < attributeMaps.length; i++ )
{
attributeMaps[i].addMapChangeListener ( this.mapChangeListener );
}
}
示例12: createStandardText
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
public void createStandardText ( final Composite parent, final String attributeName, final int style, final String label, final String textMessage, final IObservableMap data, final Object valueType )
{
final Label labelControl = this.toolkit.createLabel ( parent, label + ":" );
final boolean multi = ( style & SWT.MULTI ) > 0;
if ( multi )
{
labelControl.setLayoutData ( new GridData ( SWT.FILL, SWT.FILL, false, false ) );
}
final Text text = this.toolkit.createText ( parent, "", style );
text.setMessage ( textMessage );
final GridData gd = new GridData ( GridData.FILL, multi ? GridData.FILL : GridData.BEGINNING, true, true );
gd.horizontalSpan = 2;
text.setLayoutData ( gd );
text.setToolTipText ( textMessage );
final IObservableValue value = Observables.observeMapEntry ( data, attributeName, String.class );
if ( valueType != null && valueType != String.class )
{
final WritableValue conversionValue = new WritableValue ( null, valueType );
this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), conversionValue );
this.dbc.bindValue ( conversionValue, value );
}
else
{
this.dbc.bindValue ( WidgetProperties.text ( SWT.Modify ).observe ( text ), value );
}
}
示例13: createStandardCheckbox
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
public void createStandardCheckbox ( final Composite parent, final String attributeName, final String label, final IObservableMap data, final Object valueType )
{
final Button button = this.toolkit.createButton ( parent, label, SWT.CHECK );
{
final GridData gd = new GridData ( GridData.FILL_HORIZONTAL );
gd.horizontalSpan = 3;
button.setLayoutData ( gd );
final IObservableValue value = Observables.observeMapEntry ( data, attributeName, valueType );
this.dbc.bindValue ( WidgetProperties.selection ().observe ( button ), value );
}
}
示例14: MonitorsLabelProvider
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
public MonitorsLabelProvider ( final IObservableMap... attributeMaps )
{
super ();
for ( int i = 0; i < attributeMaps.length; i++ )
{
attributeMaps[i].addMapChangeListener ( this.mapChangeListener );
}
this.attributeMaps = attributeMaps;
this.dateFormat = DateFormat.getDateTimeInstance ( DateFormat.LONG, DateFormat.LONG );
}
示例15: EventsLabelProvider
import org.eclipse.core.databinding.observable.map.IObservableMap; //导入依赖的package包/类
public EventsLabelProvider ( final IObservableMap... attributeMaps )
{
super ();
for ( int i = 0; i < attributeMaps.length; i++ )
{
attributeMaps[i].addMapChangeListener ( this.mapChangeListener );
}
this.attributeMaps = attributeMaps;
this.dateFormat = new SimpleDateFormat ( "yyyy-MM-dd HH:mm:ss.SSS" );
}