use of aero.minova.rcp.css.widgets.MinovaSectionData in project aero.minova.rcp by minova-afis.
the class SectionGrid method fillHorizontal.
public void fillHorizontal() {
MinovaSectionData rd = (MinovaSectionData) section.getLayoutData();
rd.horizontalFill = !rd.horizontalFill;
section.requestLayout();
// Zustand speichern, damit wiederhergestellt werden kann
String key = form.getTitle() + "." + section.getData(FieldUtil.TRANSLATE_PROPERTY) + ".horizontalFill";
prefsDetailSections.put(key, rd.horizontalFill + "");
}
use of aero.minova.rcp.css.widgets.MinovaSectionData in project aero.minova.rcp by minova-afis.
the class WFCDetailPart method layoutSection.
/**
* Diese Methode bekommt einen Composite übergeben, und erstellt aus dem übergenen Objekt ein Section. Diese Sektion ist entweder der Head (Kopfdaten) oder
* eine OptionPage die sich unterhalb der Kopfdaten eingliedert. Zusätzlich wird ein TraverseListener übergeben, der das Verhalten für TAB und Enter
* festlegt.
*
* @param parent
* @param headOrPageOrGrid
*/
private void layoutSection(Composite parent, HeadOrPageOrGridWrapper headOrPageOrGrid) {
MinovaSectionData sectionData = new MinovaSectionData();
MinovaSection section;
if (headOrPageOrGrid.isHead) {
section = new MinovaSection(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED);
headSection = section;
} else {
section = new MinovaSection(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED | ExpandableComposite.TWISTIE);
section.getImageLink().addMouseListener(new MouseAdapter() {
@Override
public void mouseDoubleClick(MouseEvent e) {
minimizeSection(section);
}
});
}
section.setLayoutData(sectionData);
section.setData(TRANSLATE_PROPERTY, headOrPageOrGrid.getTranslationText());
ImageDescriptor imageDescriptor = ImageUtil.getImageDescriptor(headOrPageOrGrid.icon, false);
if (!imageDescriptor.equals(ImageDescriptor.getMissingImageDescriptor())) {
section.setImage(resManager.createImage(imageDescriptor));
}
section.addControlListener(new ControlAdapter() {
@Override
public void controlMoved(ControlEvent e) {
parent.setTabList(TabUtil.getSortedSectionTabList(parent));
}
});
// Wir erstellen die Section des Details.
MSection mSection = new MSection(headOrPageOrGrid.isHead, "open", mDetail, headOrPageOrGrid.id, section.getText());
mSection.setSectionAccessor(new SectionAccessor(mSection, section));
// Button erstellen, falls vorhanden
createButton(headOrPageOrGrid, section);
layoutSectionClient(headOrPageOrGrid, section, mSection);
section.addListener(SWT.Resize, event -> adjustScrollbar(scrolled, parent));
// Order setzen und sectionCount erhöhen
sectionCount++;
sectionData.order = sectionCount;
// Alten Zustand wiederherstellen
// HorizontalFill
String prefsHorizontalFillKey = form.getTitle() + "." + headOrPageOrGrid.getTranslationText() + ".horizontalFill";
String horizontalFillString = prefsDetailSections.get(prefsHorizontalFillKey, "false");
sectionData.horizontalFill = Boolean.parseBoolean(horizontalFillString);
// Ein-/Ausgeklappt
String prefsExpandedString = form.getTitle() + "." + headOrPageOrGrid.getTranslationText() + ".expanded";
String expandedString = prefsDetailSections.get(prefsExpandedString, "true");
section.setExpanded(Boolean.parseBoolean(expandedString));
// Minimiert
String prefsMinimizedString = form.getTitle() + "." + headOrPageOrGrid.getTranslationText() + ".minimized";
String minimizedString = prefsDetailSections.get(prefsMinimizedString, "false");
if (Boolean.parseBoolean(minimizedString)) {
minimizeSection(section);
}
detailWidth = section.getCssStyler().getSectionWidth();
section.requestLayout();
}
use of aero.minova.rcp.css.widgets.MinovaSectionData in project aero.minova.rcp by minova-afis.
the class TabUtil method getSortedSectionTabList.
/**
* Liefert ein nach der Order sortierten Array von Sections zurück.
*
* @param parent
* DetailPart
* @return nach der Order sortierte TabList
*/
public static Control[] getSortedSectionTabList(Composite parent) {
List<Control> tabList = new ArrayList<>(parent.getChildren().length);
for (Control section : parent.getChildren()) {
tabList.add(section);
}
Collections.sort(tabList, (f1, f2) -> {
int order1 = ((MinovaSectionData) f1.getLayoutData()).order;
int order2 = ((MinovaSectionData) f2.getLayoutData()).order;
boolean hFill1 = ((MinovaSectionData) f1.getLayoutData()).horizontalFill;
boolean hFill2 = ((MinovaSectionData) f2.getLayoutData()).horizontalFill;
if (hFill1 && !hFill2) {
return 1;
} else if (!hFill1 && hFill2) {
return -1;
} else if (order1 == order2) {
return 0;
} else if (order1 < order2) {
return -1;
} else {
return 1;
}
});
return tabList.toArray(new Control[0]);
}
use of aero.minova.rcp.css.widgets.MinovaSectionData in project aero.minova.rcp by minova-afis.
the class WFCStatisticDetailPart method layoutSection.
/**
* Initiales Erstellen der Section und MSection
*
* @param parent
* @param title
*/
private void layoutSection() {
section = new MinovaSection(parent, ExpandableComposite.TITLE_BAR | ExpandableComposite.EXPANDED);
section.setData(TRANSLATE_PROPERTY, "@" + STATISTIC);
MinovaSectionData sectionData = new MinovaSectionData();
section.setLayoutData(sectionData);
ImageDescriptor imageDescriptor = ImageUtil.getImageDescriptor(STATISTIC, false);
if (!imageDescriptor.equals(ImageDescriptor.getMissingImageDescriptor())) {
section.setImage(resManager.createImage(imageDescriptor));
}
mSection = new MSection(true, "open", mDetail, STATISTIC, section.getText());
mSection.setSectionAccessor(new SectionAccessor(mSection, section));
mDetail.addMSection(mSection);
// TabListe des Parts
Composite cTabFolder = parent.getParent();
cTabFolder.setTabList(TabUtil.getTabListForPart(cTabFolder, selectAllControls));
cTabFolder.getParent().setTabList(new Control[0]);
TranslateUtil.translate(parent, translationService, locale);
mPerspective.getContext().set(Constants.DETAIL_WIDTH, section.getCssStyler().getSectionWidth());
}
Aggregations