use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.
the class DatabindingsProvider method deleteAllBindings.
@Override
public void deleteAllBindings() {
// delete all
ExecutionUtils.runLog(new RunnableEx() {
@Override
public void run() throws Exception {
for (AbstractBindingInfo binding : getBindings0()) {
binding.delete();
}
}
});
getBindings().clear();
// save
saveEdit();
}
use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.
the class DatabindingsProvider method gotoDefinition.
@Override
public void gotoDefinition(IBindingInfo ibinding) {
try {
AbstractBindingInfo binding = (AbstractBindingInfo) ibinding;
String source = binding.getDefinitionSource(this);
//
if (source != null) {
int position = m_javaInfoRoot.getEditor().getEnclosingNode(source).getStartPosition();
IDesignPageSite site = IDesignPageSite.Helper.getSite(m_javaInfoRoot);
site.openSourcePosition(position);
}
} catch (Throwable e) {
}
}
use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.
the class DatabindingsProvider method addBinding.
@Override
public void addBinding(final IBindingInfo ibinding) {
// post process
ExecutionUtils.runLog(new RunnableEx() {
@Override
public void run() throws Exception {
AbstractBindingInfo binding = (AbstractBindingInfo) ibinding;
binding.create();
}
});
// add
getBindings().add(ibinding);
// save
saveEdit();
}
use of org.eclipse.wb.internal.rcp.databinding.model.AbstractBindingInfo in project windowbuilder by eclipse.
the class GlobalObservableFactory method createDetailObservable.
// //////////////////////////////////////////////////////////////////////////
//
// IGlobalObservableFactory: Observable
//
// //////////////////////////////////////////////////////////////////////////
@Override
public ObservableInfo createDetailObservable(SingleSelectionObservableInfo masterObservable, BindableInfo object, Type type) throws Exception {
if (masterObservable.isViewer()) {
// prepare input
ObservableInfo inputObservable = null;
BindableInfo property = object.resolvePropertyReference("setInput");
for (AbstractBindingInfo binding : object.getBindings()) {
if (binding.getTargetProperty() == property) {
AbstractViewerInputBindingInfo viewerBinding = (AbstractViewerInputBindingInfo) binding;
inputObservable = viewerBinding.getInputObservable();
break;
}
}
// create detail observable
if (inputObservable instanceof ListEmfObservableInfo) {
PropertiesSupport propertiesSupport = getPropertiesSupport(inputObservable);
boolean version_2_5 = propertiesSupport.isEMFProperties();
ObservableInfo observable = null;
//
if (type == Type.OnlyValue) {
observable = new DetailValueEmfObservableInfo(masterObservable, propertiesSupport);
//
if (version_2_5) {
observable.setCodeSupport(new EmfValuePropertyDetailCodeSupport());
} else {
observable.setCodeSupport(new EmfObservableDetailValueCodeSupport());
}
} else if (type == Type.OnlyList) {
observable = new DetailListEmfObservableInfo(masterObservable, propertiesSupport);
//
if (version_2_5) {
observable.setCodeSupport(new EmfListPropertyDetailCodeSupport());
} else {
observable.setCodeSupport(new EmfObservableDetailListCodeSupport());
}
}
return observable;
}
}
return null;
}
Aggregations