下面列出了org.eclipse.ui.forms.widgets.ScrolledForm#reflow ( ) 实例代码,或者点击链接到github查看源代码,也可以在右侧发表评论。
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform,
Labels.name(setup.productSystem),
Images.get(result));
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
createCombos(body, tk);
SashForm sash = new SashForm(body, SWT.VERTICAL);
UI.gridData(sash, true, true);
tk.adapt(sash);
createTree(sash, tk);
map = ResultMap.on(sash, tk);
form.reflow(true);
refreshSelection();
}
@Override
protected void createFormContent(IManagedForm mform) {
String title = M.Diff;
if (this.title != null)
title += ": " + this.title;
ScrolledForm form = UI.formHeader(mform, title);
if (logo != null)
form.setImage(logo);
FormToolkit toolkit = mform.getToolkit();
Composite body = form.getBody();
UI.gridLayout(body, 1, 0, 0);
toolkit.paintBordersFor(body);
UI.gridData(body, true, true);
if (editMode)
editor = DiffEditor.forEditing(body, toolkit);
else
editor = DiffEditor.forViewing(body, toolkit);
editor.initialize(root, labelProvider, dependencyResolver, action);
UI.gridData(editor, true, true);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform,
Labels.name(setup.productSystem),
Images.get(result));
toolkit = mform.getToolkit();
Composite body = UI.formBody(form, toolkit);
Section section = UI.section(body, toolkit, M.ImpactAnalysis + ": "
+ Labels.name(setup.impactMethod));
UI.gridData(section, true, true);
Composite client = toolkit.createComposite(section);
section.setClient(client);
UI.gridLayout(client, 1);
createOptions(client);
createTree(client);
spinner.register(viewer);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(this);
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
Section section = UI.section(body, tk, M.ImpactFactors);
UI.gridData(section, true, true);
Composite client = tk.createComposite(section);
section.setClient(client);
UI.gridLayout(client, 1);
render(client, section);
List<ImpactFactor> factors = impact().impactFactors;
sortFactors(factors);
viewer.setInput(factors);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(this);
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
TableViewer table = Tables.createViewer(body,
M.ImpactCategory, M.Location,
M.ImpactFactor, M.Unit);
table.setLabelProvider(new Label());
table.setInput(loadFactors());
Tables.bindColumnWidths(table, 0.4, 0.2, 0.2, 0.2);
Action onOpen = Actions.onOpen(() -> {
Factor f = Viewers.getFirstSelected(table);
if (f != null) {
App.openEditor(f.impact);
}
});
Actions.bind(table, onOpen);
Tables.onDoubleClick(table, e -> onOpen.run());
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(this);
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
InfoSection info = new InfoSection(getEditor());
info.render(body, tk);
checkBox(info.getContainer(),
M.InfrastructureProcess, "infrastructureProcess");
createButtons(info.getContainer(), tk);
createTimeSection(body, tk);
createGeographySection(body, tk);
createTechnologySection(body, tk);
new ImageSection(getEditor(), tk, body);
createDqSection(body, tk);
body.setFocus();
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ContributionResult result = editor.result;
ScrolledForm form = UI.formHeader(mform,
Labels.name(editor.setup.productSystem),
Images.get(editor.result));
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
InfoSection.create(body, tk, editor.setup);
if (editor.dqResult != null) {
new DQInfoSection(body, tk, result, editor.dqResult);
}
if (result.hasImpactResults()) {
ContributionChartSection.forImpacts(editor).render(body, tk);
}
ContributionChartSection.forFlows(editor).render(body, tk);
form.reflow(true);
}
/**
* <p>
* This operation creates actions in the toolbar for the block.
* </p>
*
* @param managedForm
* <p>
* The parent Form
* </p>
*/
@Override
protected void createToolBarActions(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
Action haction = new Action("Horizontal Orientation",
IAction.AS_RADIO_BUTTON) {
@Override
public void run() {
sashForm.setOrientation(SWT.HORIZONTAL);
form.reflow(true);
}
};
haction.setChecked(true);
haction.setToolTipText("Set Details to the Right of Masters");
Action vaction = new Action("Vertical Orientation",
IAction.AS_RADIO_BUTTON) {
@Override
public void run() {
sashForm.setOrientation(SWT.VERTICAL);
form.reflow(true);
}
};
vaction.setChecked(false);
vaction.setToolTipText("Set Details Below Masters");
form.getToolBarManager().add(haction);
form.getToolBarManager().add(vaction);
}
/**
* Creates the tool bar actions.
*
* @param managedForm the managed form
*/
protected void createToolBarActions(IManagedForm managedForm) {
final ScrolledForm form = managedForm.getForm();
haction = new Action("hor", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
@Override
public void run() {
sashForm.setOrientation(SWT.HORIZONTAL);
form.reflow(true);
}
};
haction.setChecked(true);
haction.setToolTipText("Horizontal Orientation");
TAEConfiguratorPlugin instance = TAEConfiguratorPlugin.getDefault();
haction.setImageDescriptor(instance
.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
haction.setDisabledImageDescriptor(instance
.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_HORIZONTAL));
vaction = new Action("ver", IAction.AS_RADIO_BUTTON) { //$NON-NLS-1$
@Override
public void run() {
sashForm.setOrientation(SWT.VERTICAL);
form.reflow(true);
}
};
vaction.setChecked(false);
vaction.setToolTipText("Vertical Orientation");
vaction.setImageDescriptor(instance
.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
vaction.setDisabledImageDescriptor(instance
.getImageDescriptor(TAEConfiguratorPlugin.IMAGE_TH_VERTICAL));
form.getToolBarManager().add(haction);
form.getToolBarManager().add(vaction);
form.updateToolBar();
maybeInitialize(managedForm);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform, M.CommitChangesToRepository);
FormToolkit toolkit = mform.getToolkit();
Composite body = form.getBody();
body.setLayout(new GridLayout());
toolkit.paintBordersFor(body);
UI.gridData(body, true, true);
createCommitMessage(body, toolkit);
createModelViewer(body, toolkit);
form.reflow(true);
viewer.setInput(Collections.singleton(node));
viewer.setSelection(initialSelection);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform, M.ChangesToBeFetched);
FormToolkit toolkit = mform.getToolkit();
Composite body = form.getBody();
body.setLayout(new GridLayout());
toolkit.paintBordersFor(body);
UI.gridData(body, true, true);
CommitEntryViewer viewer = new CommitEntryViewer(body, client);
form.reflow(true);
viewer.setInput(commits);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform, M.LibraryDataSets);
FormToolkit toolkit = mform.getToolkit();
Composite body = form.getBody();
body.setLayout(new GridLayout());
toolkit.paintBordersFor(body);
UI.gridData(body, true, true);
String description = M.RecognizedLibraryDatasetsDescription;
Label label = toolkit.createLabel(body, description, SWT.WRAP);
UI.gridData(label, true, false).widthHint = 750;
Viewer viewer = new Viewer(body);
form.reflow(true);
viewer.setInput(restrictions);
}
@Override
protected void createFormContent(IManagedForm mform) {
toolkit = mform.getToolkit();
ScrolledForm form = UI.formHeader(mform,
Labels.name(setup.productSystem),
Images.get(result));
Composite body = UI.formBody(form, toolkit);
createFlowSection(body);
if (result.hasImpactResults())
createImpactSection(body);
form.reflow(true);
setInputs();
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform, "Flow mapping");
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
createInfoSection(tk, body);
createTable(body, tk);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(this);
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
setupSection(body, tk);
paramSection = new GeoParamSection(this);
paramSection.drawOn(body, tk);
flowSection = new GeoFlowSection(this);
flowSection.drawOn(body, tk);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(this);
FormToolkit toolkit = mform.getToolkit();
Composite body = UI.formBody(form, toolkit);
InfoSection info = new InfoSection(getEditor());
info.render(body, toolkit);
Composite comp = info.getContainer();
text(comp, M.ReferenceUnit, "referenceUnit");
body.setFocus();
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(this);
FormToolkit tk = mform.getToolkit();
Composite body = UI.formBody(form, tk);
InfoSection info = new InfoSection(getEditor());
info.render(body, tk);
createIndicatorTable(tk, body);
body.setFocus();
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mform) {
ScrolledForm form = UI.formHeader(mform,
Labels.name(setup.productSystem),
Images.get(result));
FormToolkit toolkit = mform.getToolkit();
Composite body = UI.formBody(form, toolkit);
createGroupingSection(toolkit, body);
resultSection = new GroupResultSection(groups, result);
resultSection.render(body, toolkit);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm managedForm) {
ScrolledForm form = UI.formHeader(this);
tk = managedForm.getToolkit();
Composite body = UI.formBody(form, tk);
createInfoSection(body);
createAddButton(body);
sectionList = new SectionList(editor, body, form, tk);
form.reflow(true);
}
@Override
protected void createFormContent(IManagedForm mForm) {
String title = getTitle();
Image image = null;
if (model != null) {
title += ": " + model.name;
image = Images.get(model);
}
ScrolledForm form = UI.formHeader(mForm, title, image);
Composite body = UI.formBody(form, mForm.getToolkit());
body.setLayout(new FillLayout());
Browser browser = new Browser(body, SWT.NONE);
browser.setJavascriptEnabled(true);
UI.bindFunction(browser, "getLabel", (args) -> {
if (args == null || args.length == 0)
return "";
Object path = args[0];
if (path == null)
return "";
return CommentLabels.get(path.toString());
});
UI.bindFunction(browser, "openModel", (args) -> {
if (args == null || args.length < 2)
return null;
Object type = args[0];
Object refId = args[1];
if (type == null || refId == null)
return null;
App.openEditor(getDescriptor(
ModelType.valueOf(type.toString()),
refId.toString()));
return null;
});
UI.onLoaded(browser, HtmlFolder.getUrl("comments.html"), () -> {
Gson gson = new Gson();
for (Comment comment : comments) {
String fullPath = getFullPath(comment);
fullPath = fullPath != null
? "'" + fullPath + "'"
: fullPath;
browser.execute("add(" + gson.toJson(comment)
+ ", false, " + fullPath + ");");
}
});
form.reflow(true);
}