use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.
the class AbstractOutline method initConfig.
@Override
protected void initConfig() {
// default visible
m_visible = NamedBitMaskHelper.ALL_BITS_SET;
m_contextPageOptimisticLock = new OptimisticLock();
setPageChangeStrategy(createPageChangeStrategy());
m_outlineMediator = createOutlineMediator();
addTreeListener(new P_OutlineListener());
addNodeFilter(new P_TableFilterBasedTreeNodeFilter());
super.initConfig();
IPage<?> rootPage = interceptCreateRootPage();
setRootNode(rootPage);
setEnabled(getConfiguredEnabled());
setVisible(getConfiguredVisible());
setOrder(calculateViewOrder());
setNavigateButtonsVisible(getConfiguredNavigateButtonsVisible());
setOutlineOverviewVisible(getConfiguredOutlineOverviewVisible());
ensureDefaultDetailFormCreated();
ensureDefaultDetailFormStarted();
}
use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.
the class OptimisticLockTest method testInitiallyNotAcqiured.
@Test
public void testInitiallyNotAcqiured() throws Exception {
OptimisticLock l = new OptimisticLock();
assertFalse(l.isAcquired());
assertTrue(l.isReleased());
}
use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.
the class OptimisticLockTest method testAcquire.
@Test
public void testAcquire() {
OptimisticLock l = new OptimisticLock();
boolean acquired = l.acquire();
assertTrue(acquired);
assertTrue(l.isAcquired());
assertFalse(l.isReleased());
}
use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.
the class OptimisticLockTest method testMultipleAcquiresReleases.
@Test
public void testMultipleAcquiresReleases() {
OptimisticLock l = new OptimisticLock();
l.acquire();
l.acquire();
l.release();
l.release();
assertFalse(l.isAcquired());
assertTrue(l.isReleased());
}
use of org.eclipse.scout.rt.platform.util.concurrent.OptimisticLock in project scout.rt by eclipse.
the class AbstractSequenceBox method initConfig.
@Override
protected void initConfig() {
m_labelCompositionLock = new OptimisticLock();
m_grid = new SequenceBoxGrid();
super.initConfig();
setAutoCheckFromTo(getConfiguredAutoCheckFromTo());
setEqualColumnWidths(getConfiguredEqualColumnWidths());
// when range box has visible label, suppress first field's label and append
// to own label
propertySupport.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
if (e.getPropertyName().equals(IFormField.PROP_LABEL_VISIBLE) || e.getPropertyName().equals(IFormField.PROP_LABEL) || e.getPropertyName().equals(IFormField.PROP_VISIBLE)) {
updateLabelComposition();
}
}
});
// If inner fields change their visibility dynamically, the label of the SequenceBox might change.
for (IFormField field : getFields()) {
field.addPropertyChangeListener(new PropertyChangeListener() {
@Override
public void propertyChange(PropertyChangeEvent e) {
if (e.getPropertyName().equals(IFormField.PROP_LABEL_VISIBLE) || e.getPropertyName().equals(IFormField.PROP_LABEL) || e.getPropertyName().equals(IFormField.PROP_VISIBLE)) {
updateLabelComposition();
}
}
});
}
updateLabelComposition();
hideFieldStatusOfChildren();
// attach change triggers
attachCheckFromToListeners();
}
Aggregations