use of org.springsource.ide.eclipse.dashboard.ui.AbstractDashboardPart in project eclipse-integration-commons by spring-projects.
the class DashboardMainPage method setUpExpandableSection.
private void setUpExpandableSection(final Section section, final String prefId, boolean defaultExpanded) {
section.setExpanded(getStoredExpandedState(prefId, defaultExpanded));
section.addExpansionListener(new ExpansionAdapter() {
@Override
public void expansionStateChanged(ExpansionEvent e) {
if (e.getState()) {
prefStore.setValue(prefId, IIdeUiConstants.SECTION_EXPANDED);
} else {
prefStore.setValue(prefId, IIdeUiConstants.SECTION_COLLAPSED);
}
if (isContributedSection(section)) {
// If we're expanding a contributed section, close the
// update section...
updateSection.setExpanded(false);
prefStore.setValue(IIdeUiConstants.PREF_UPDATE_SECTION_COLLAPSE, IIdeUiConstants.SECTION_COLLAPSED);
}
// interest
for (AbstractDashboardPart part : parts) {
if (!section.equals(part.getControl()) && part.getControl() instanceof Section) {
((Section) part.getControl()).setExpanded(false);
prefStore.setValue(getExpansionPropertyId(part), IIdeUiConstants.SECTION_COLLAPSED);
}
}
adjustCollapsableSections();
}
});
}
use of org.springsource.ide.eclipse.dashboard.ui.AbstractDashboardPart in project eclipse-integration-commons by spring-projects.
the class DashboardMainPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
toolkit = managedForm.getToolkit();
form = managedForm.getForm();
unfinishedJobs = new CopyOnWriteArraySet<AggregateFeedJob>();
// get dark gray color as FormText display it lighter as other widgets
feedColor = new Color(Display.getDefault(), 70, 70, 70);
// getHeaderForm().setText(null);// "SpringSource Tool Suite");
toolkit.decorateFormHeading(form.getForm());
prefStore = IdeUiPlugin.getDefault().getPreferenceStore();
GridLayout compositeLayout = new GridLayout(2, true);
compositeLayout.marginHeight = 0;
compositeLayout.marginTop = 5;
compositeLayout.verticalSpacing = 0;
Composite body = form.getBody();
body.setLayout(compositeLayout);
Composite leftComposite = toolkit.createComposite(body);
leftComposite.setLayout(new GridLayout());
GridDataFactory.fillDefaults().grab(true, true).applyTo(leftComposite);
Composite rightComposite = toolkit.createComposite(body);
rightComposite.setLayout(new GridLayout());
GridDataFactory.fillDefaults().grab(true, true).applyTo(rightComposite);
createHeader();
createNewProjectsSection(leftComposite);
createUpdateSection(leftComposite);
parts = contributeParts(leftComposite, AbstractDashboardPart.ID_PATH_DOC);
for (AbstractDashboardPart part : parts) {
if (part.getControl() instanceof Section) {
String expansionProp = getExpansionPropertyId(part);
Section section = (Section) part.getControl();
GridDataFactory.fillDefaults().grab(false, getStoredExpandedState(expansionProp, false)).applyTo(section);
setUpExpandableSection(section, expansionProp, false);
}
}
createHelpSection(leftComposite);
createFeedsSection(rightComposite, "Feeds", FeedType.BLOG, "blog");
searchBox.setFocus();
ResourceProvider.getInstance().addPropertyChangeListener(this);
}
use of org.springsource.ide.eclipse.dashboard.ui.AbstractDashboardPart in project eclipse-integration-commons by spring-projects.
the class DashboardMainPage method adjustCollapsableSections.
private void adjustCollapsableSections() {
GridDataFactory.fillDefaults().grab(true, updateSection.isExpanded()).applyTo(updateSection);
for (AbstractDashboardPart part : parts) {
if (part.getControl() instanceof Section) {
Section section = (Section) part.getControl();
GridDataFactory.fillDefaults().grab(true, section.isExpanded()).applyTo(section);
}
}
GridDataFactory.fillDefaults().grab(true, !updateSection.isExpanded() && areAllContributedSectionsCollapsed() && helpSection.isExpanded()).applyTo(helpSection);
form.getBody().layout(true, true);
form.reflow(true);
}
Aggregations