use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class GenericPropertyImpl method process_NLSSupport_specialFunctionality.
private boolean process_NLSSupport_specialFunctionality(final Object value) throws Exception {
if (value == UNKNOWN_VALUE) {
return false;
}
if (!NlsSupport.isStringProperty(this)) {
return false;
}
final NlsSupport support = NlsSupport.get(m_javaInfo);
// check if key name is used
if (value instanceof String) {
String stringValue = (String) value;
String keyPrefix = m_javaInfo.getDescription().getToolkit().getPreferences().getString(IPreferenceConstants.P_NLS_KEY_AS_VALUE_PREFIX);
if (!StringUtils.isEmpty(keyPrefix) && stringValue.startsWith(keyPrefix)) {
final String key = stringValue.substring(keyPrefix.length());
final AbstractSource source = support.getKeySource(key);
if (source != null) {
ExecutionUtils.run(m_javaInfo, new RunnableEx() {
@Override
public void run() throws Exception {
source.useKey(m_this, key);
}
});
return true;
}
}
}
// check for externalized String property
{
final Expression expression = getExpression();
if (expression != null) {
if (support.isExternalized(expression)) {
ExecutionUtils.run(m_javaInfo, new RunnableEx() {
@Override
public void run() throws Exception {
String string = value == UNKNOWN_VALUE ? null : (String) value;
support.setValue(expression, string);
}
});
return true;
}
}
}
// no NLS
return false;
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class XmlObjectInfo method delete.
@Override
public void delete() throws Exception {
final ObjectInfo parent = getParent();
ObjectInfo hierarchyObject = parent != null ? parent : this;
ExecutionUtils.run(hierarchyObject, new RunnableEx() {
@Override
public void run() throws Exception {
putArbitraryValue(FLAG_DELETING, Boolean.TRUE);
try {
// broadcast "before"
getBroadcast(ObjectInfoDelete.class).before(parent, XmlObjectInfo.this);
// delete creation
m_creationSupport.delete();
// broadcast "after"
getBroadcast(ObjectInfoDelete.class).after(parent, XmlObjectInfo.this);
} finally {
removeArbitraryValue(FLAG_DELETING);
}
}
});
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class DatabindingsProvider method editBinding.
public void editBinding(final IBindingInfo ibinding) {
// edit
ExecutionUtils.runLog(new RunnableEx() {
public void run() throws Exception {
BindingInfo binding = (BindingInfo) ibinding;
binding.edit(m_rootInfo.getBindings());
}
});
// save
saveEdit();
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class DimensionSelectionEditPolicy method flipGrow.
// //////////////////////////////////////////////////////////////////////////
//
// Keyboard
//
// //////////////////////////////////////////////////////////////////////////
/**
* Set/unset the "grow" flag.
*/
private void flipGrow() {
final MigLayoutInfo layout = getLayout();
ExecutionUtils.run(layout, new RunnableEx() {
public void run() throws Exception {
getDimension().flipGrow();
layout.writeDimensions();
}
});
}
use of org.eclipse.wb.internal.core.utils.execution.RunnableEx in project windowbuilder by eclipse.
the class RowSelectionEditPolicy method setAlignment.
/**
* Sets the alignment for {@link MigRowInfo}.
*/
private void setAlignment(final MigRowInfo.Alignment alignment) {
final MigLayoutInfo layout = getLayout();
ExecutionUtils.run(layout, new RunnableEx() {
public void run() throws Exception {
getDimension().setAlignment(alignment);
layout.writeDimensions();
}
});
}
Aggregations