use of org.eclipse.scout.rt.platform.util.collection.OrderedCollection in project scout.rt by eclipse.
the class AbstractTabBox method initMenus.
private void initMenus() {
List<Class<? extends IMenu>> declaredMenus = getDeclaredMenus();
List<IMenu> contributedMenus = m_contributionHolder.getContributionsByClass(IMenu.class);
OrderedCollection<IMenu> menus = new OrderedCollection<IMenu>();
for (Class<? extends IMenu> menuClazz : declaredMenus) {
try {
menus.addOrdered(ConfigurationUtility.newInnerInstance(this, menuClazz));
} catch (Exception e) {
BEANS.get(ExceptionHandler.class).handle(new ProcessingException("error creating instance of class '" + menuClazz.getName() + "'.", e));
}
}
menus.addAllOrdered(contributedMenus);
try {
injectMenusInternal(menus);
} catch (Exception e) {
LOG.error("error occured while dynamically contributing menus.", e);
}
new MoveActionNodesHandler<IMenu>(menus).moveModelObjects();
// set container on menus
IFormFieldContextMenu contextMenu = new FormFieldContextMenu<ITabBox>(this, menus.getOrderedList());
contextMenu.setContainerInternal(this);
setContextMenu(contextMenu);
}
use of org.eclipse.scout.rt.platform.util.collection.OrderedCollection in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithTooLongText2.
@Test
public void testLookupRowWithTooLongText2() throws Exception {
final AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
@Override
protected boolean getConfiguredEditable() {
return true;
}
@Override
protected int getConfiguredMaxLength() {
return 8;
}
};
column.setCodeTypeClass(TestCodeType.class);
final ITable table = new AbstractTable() {
@Override
protected void injectColumnsInternal(OrderedCollection<IColumn<?>> columns) {
columns.addFirst(column);
}
};
ITableRow row = table.addRow();
@SuppressWarnings("unchecked") IProposalField<Long> field = (IProposalField<Long>) column.prepareEditInternal(row);
field.getUIFacade().acceptProposalFromUI("1234567890", false, false);
column.completeEdit(row, field);
assertEquals("12345678", column.getValue(row));
}
use of org.eclipse.scout.rt.platform.util.collection.OrderedCollection in project scout.rt by eclipse.
the class AbstractProposalColumnTest method testLookupRowWithTooLongText1.
@Test
public void testLookupRowWithTooLongText1() throws Exception {
final AbstractProposalColumn<Long> column = new AbstractProposalColumn<Long>() {
@Override
protected boolean getConfiguredEditable() {
return true;
}
@Override
protected int getConfiguredMaxLength() {
return 32;
}
};
column.setCodeTypeClass(TestCodeType.class);
final ITable table = new AbstractTable() {
@Override
protected void injectColumnsInternal(OrderedCollection<IColumn<?>> columns) {
columns.addFirst(column);
}
};
ITableRow row = table.addRow();
@SuppressWarnings("unchecked") IProposalField<Long> field = (IProposalField<Long>) column.prepareEditInternal(row);
field.getUIFacade().acceptProposalFromUI("1234567890", false, false);
column.completeEdit(row, field);
assertEquals("1234567890", column.getValue(row));
}
Aggregations