Search in sources :

Example 1 with AbstractDesktop

use of org.eclipse.scout.rt.client.ui.desktop.AbstractDesktop in project scout.rt by eclipse.

the class OutlineDeepLinkHandlerTest method addOutlineToDesktop.

/**
 * Adds an outline to the desktop by reflection.
 */
private void addOutlineToDesktop(IDesktop desktop, IOutline outline) throws ReflectiveOperationException {
    AbstractDesktop ad = (AbstractDesktop) desktop;
    Field field = AbstractDesktop.class.getDeclaredField("m_availableOutlines");
    field.setAccessible(true);
    @SuppressWarnings("unchecked") List<IOutline> outlines = (List<IOutline>) field.get(ad);
    outlines.add(outline);
}
Also used : AbstractDesktop(org.eclipse.scout.rt.client.ui.desktop.AbstractDesktop) Field(java.lang.reflect.Field) IOutline(org.eclipse.scout.rt.client.ui.desktop.outline.IOutline) List(java.util.List)

Aggregations

Field (java.lang.reflect.Field)1 List (java.util.List)1 AbstractDesktop (org.eclipse.scout.rt.client.ui.desktop.AbstractDesktop)1 IOutline (org.eclipse.scout.rt.client.ui.desktop.outline.IOutline)1