use of org.eclipse.ui.forms.widgets.ScrolledForm in project bndtools by bndtools.
the class BundleContentPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
FormToolkit toolkit = managedForm.getToolkit();
managedForm.setInput(model);
ScrolledForm scrolledForm = managedForm.getForm();
scrolledForm.setText("Bundle Content");
Form form = scrolledForm.getForm();
toolkit.decorateFormHeading(form);
form.addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
Composite body = form.getBody();
// Create controls
MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
sashForm.setSashWidth(6);
toolkit.adapt(sashForm, false, false);
Composite leftPanel = toolkit.createComposite(sashForm);
createLeftPanel(managedForm, leftPanel);
Composite rightPanel = toolkit.createComposite(sashForm);
createRightPanel(managedForm, rightPanel);
sashForm.setWeights(new int[] { 1, 1 });
sashForm.hookResizeListener();
// Layout
body.setLayout(new FillLayout());
}
use of org.eclipse.ui.forms.widgets.ScrolledForm in project bndtools by bndtools.
the class TestSuitesPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
managedForm.setInput(model);
FormToolkit toolkit = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText("Tests");
form.setImage(junitImg);
toolkit.decorateFormHeading(form.getForm());
form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
Composite body = form.getBody();
MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
sashForm.setSashWidth(6);
toolkit.adapt(sashForm, false, false);
Composite leftPanel = toolkit.createComposite(sashForm);
Composite rightPanel = toolkit.createComposite(sashForm);
TestSuitesPart suitesPart = new TestSuitesPart(leftPanel, toolkit, Section.TITLE_BAR | Section.EXPANDED);
managedForm.addPart(suitesPart);
SaneDetailsPart detailsPart = new SaneDetailsPart();
managedForm.addPart(detailsPart);
// TODO: add details pages here
detailsPart.createContents(toolkit, rightPanel);
sashForm.hookResizeListener();
// LAYOUT
body.setLayout(new FillLayout());
GridLayout layout;
GridData gd;
layout = new GridLayout();
leftPanel.setLayout(layout);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
suitesPart.getSection().setLayoutData(gd);
layout = new GridLayout();
rightPanel.setLayout(layout);
}
use of org.eclipse.ui.forms.widgets.ScrolledForm in project bndtools by bndtools.
the class ProjectBuildPage method createFormContent.
@Override
protected void createFormContent(IManagedForm managedForm) {
managedForm.setInput(model);
FormToolkit tk = managedForm.getToolkit();
ScrolledForm form = managedForm.getForm();
form.setText("Project Build");
tk.decorateFormHeading(form.getForm());
form.getForm().addMessageHyperlinkListener(new MessageHyperlinkAdapter(getEditor()));
GridLayout layout;
GridData gd;
// Create Controls
Composite body = form.getBody();
body.setLayout(new FillLayout());
MDSashForm sashForm = new MDSashForm(body, SWT.HORIZONTAL, managedForm);
sashForm.setSashWidth(6);
tk.adapt(sashForm, false, false);
sashForm.hookResizeListener();
Composite leftPanel = tk.createComposite(sashForm);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
leftPanel.setLayoutData(gd);
layout = new GridLayout(1, false);
leftPanel.setLayout(layout);
SubBundlesPart subBundlesPart = new SubBundlesPart(leftPanel, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
managedForm.addPart(subBundlesPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
subBundlesPart.getSection().setLayoutData(gd);
BuildPathPart buildPathPart = new BuildPathPart(leftPanel, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
managedForm.addPart(buildPathPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
gd.widthHint = 50;
gd.heightHint = 50;
buildPathPart.getSection().setLayoutData(gd);
Composite rightPanel = tk.createComposite(sashForm);
gd = new GridData(SWT.FILL, SWT.FILL, true, true);
rightPanel.setLayoutData(gd);
BuildOperationsPart buildOpsPart = new BuildOperationsPart(rightPanel, tk, Section.TITLE_BAR | Section.EXPANDED | Section.DESCRIPTION);
managedForm.addPart(buildOpsPart);
gd = new GridData(SWT.FILL, SWT.FILL, true, false);
buildOpsPart.getSection().setLayoutData(gd);
layout = new GridLayout(1, false);
rightPanel.setLayout(layout);
reportProblemsInHeader();
}
use of org.eclipse.ui.forms.widgets.ScrolledForm in project bndtools by bndtools.
the class BndEditor method loadEditModel.
private void loadEditModel() throws Exception {
// Create the bnd edit model and workspace
Workspace ws = Central.getWorkspaceIfPresent();
Project bndProject = Run.createRun(ws, inputFile);
model.setWorkspace(bndProject.getWorkspace());
model.setProject(bndProject);
// Load content into the edit model
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
final IDocumentProvider docProvider = sourcePage.getDocumentProvider();
// #1625: Ensure the IDocumentProvider is not null.
if (docProvider != null) {
IDocument document = docProvider.getDocument(getEditorInput());
try {
model.loadFrom(new IDocumentWrapper(document));
model.setBndResource(inputFile);
} catch (IOException e) {
logger.logError("Unable to load edit model", e);
}
for (int i = 0; i < getPageCount(); i++) {
Control control = getControl(i);
if (control instanceof ScrolledForm) {
ScrolledForm form = (ScrolledForm) control;
if (SYNC_MESSAGE.equals(form.getMessage())) {
form.setMessage(null, IMessageProvider.NONE);
}
}
}
}
}
});
}
use of org.eclipse.ui.forms.widgets.ScrolledForm in project bndtools by bndtools.
the class BndEditorPart method refresh.
@Override
public final void refresh() {
if (!Central.hasWorkspaceDirectory()) {
refreshFromModel();
} else {
Central.onWorkspaceInit(new Success<Workspace, Void>() {
@Override
public Promise<Void> call(Promise<Workspace> resolved) throws Exception {
try {
Display.getDefault().asyncExec(new Runnable() {
@Override
public void run() {
refreshFromModel();
ScrolledForm form = getManagedForm().getForm();
if (BndEditor.SYNC_MESSAGE.equals(form.getMessage())) {
form.setMessage(null, IMessageProvider.NONE);
}
}
});
} catch (Exception e) {
}
return Promises.resolved(null);
}
});
}
super.refresh();
}
Aggregations