use of aero.minova.rcp.css.widgets.DetailLayout in project aero.minova.rcp by minova-afis.
the class WFCDetailPart method layoutForm.
private void layoutForm(Composite parent) {
// Wir wollen eine horizontale Scrollbar, damit auch bei breiten Details alles erreichbar ist
scrolled = new ScrolledComposite(parent, SWT.H_SCROLL | SWT.V_SCROLL);
Composite wrap = new Composite(scrolled, SWT.NO_SCROLL);
DetailLayout detailLayout = new DetailLayout();
wrap.setLayout(detailLayout);
parent.setData(Constants.DETAIL_COMPOSITE, wrap);
mPerspective.getContext().set(Constants.DETAIL_LAYOUT, detailLayout);
// Abschnitte der Hauptmaske und OPs erstellen
for (Object headOrPage : form.getDetail().getHeadAndPageAndGrid()) {
HeadOrPageOrGridWrapper wrapper = new HeadOrPageOrGridWrapper(headOrPage);
layoutSection(wrap, wrapper);
}
loadOptionPages(wrap);
scrolled.setContent(wrap);
scrolled.setExpandHorizontal(true);
scrolled.setExpandVertical(true);
scrolled.addListener(SWT.Resize, event -> adjustScrollbar(scrolled, wrap));
// Setzen der TabListe der Sections.
parent.setTabList(parent.getChildren());
// Holen des Parts
Composite part = parent.getParent();
// Setzen der TabListe des Parts. Dabei bestimmt SelectAllControls, ob die Toolbar mit selektiert wird.
part.setTabList(TabUtil.getTabListForPart(part, selectAllControls));
// Wir setzen eine leere TabListe für die Perspektive, damit nicht durch die Anwendung mit Tab navigiert werden kann.
part.getParent().setTabList(new Control[0]);
// Helper-Klasse initialisieren
initializeHelper(form.getHelperClass());
}
use of aero.minova.rcp.css.widgets.DetailLayout in project aero.minova.rcp by minova-afis.
the class WFCStatisticDetailPart method postConstruct.
@PostConstruct
public void postConstruct(Composite parent) {
this.parent = parent;
formToolkit = new FormToolkit(parent.getDisplay());
resManager = new LocalResourceManager(JFaceResources.getResources(), parent);
mDetail = new MDetail();
mDetail.setDetailAccessor(new DetailAccessor(mDetail));
DetailLayout detailLayout = new DetailLayout();
parent.setLayout(detailLayout);
mPerspective.getContext().set(Constants.DETAIL_LAYOUT, detailLayout);
layoutSection();
}
use of aero.minova.rcp.css.widgets.DetailLayout in project aero.minova.rcp by minova-afis.
the class OptimizeDetailHandler method execute.
@Execute
public void execute(EModelService emservice, MWindow mwindow, MPerspective mPerspective) {
MPart detail = emservice.findElements(emservice.getActivePerspective(mwindow), "aero.minova.rcp.rcp.part.details", MPart.class).get(0);
Integer defaultSectionWidth = (Integer) mPerspective.getContext().get(Constants.DETAIL_WIDTH);
// Detail-Composite finden (Kann auch Statistik-Part sein)
Composite detailComposite;
if (detail.getObject() instanceof WFCDetailPart) {
WFCDetailPart wfcDetailPart = (WFCDetailPart) detail.getObject();
detailComposite = (Composite) wfcDetailPart.getComposite().getData(Constants.DETAIL_COMPOSITE);
} else {
WFCStatisticDetailPart wfcStatisticDetailPart = (WFCStatisticDetailPart) detail.getObject();
detailComposite = wfcStatisticDetailPart.getComposite();
}
// Optimale Breite des Details. Dabei werden die horizontalFill-Abschnitte ignoriert
DetailLayout detailLayout = (DetailLayout) mPerspective.getContext().get(Constants.DETAIL_LAYOUT);
int prefDetailWidth = detailLayout.layout(detailComposite, false, detailComposite.getSize().x, false, false).x;
int size = 100000;
float detailSize = (float) (prefDetailWidth + 35.0) / mwindow.getWidth();
float leftSize = 1.0f - detailSize;
MPartSashContainer element = emservice.findElements(emservice.getActivePerspective(mwindow), "aero.minova.rcp.rcp.partsashcontainer.main", MPartSashContainer.class).get(0);
for (MPartSashContainerElement e : element.getChildren()) {
if (e.getElementId() != null && e.getElementId().equalsIgnoreCase("aero.minova.rcp.rcp.partstack.details")) {
e.setContainerData(Integer.toString((int) (detailSize * size)));
} else {
e.setContainerData(Integer.toString((int) (leftSize * size)));
}
}
}
Aggregations