本文整理汇总了Java中org.eclipse.ui.forms.widgets.Form类的典型用法代码示例。如果您正苦于以下问题:Java Form类的具体用法?Java Form怎么用?Java Form使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Form类属于org.eclipse.ui.forms.widgets包,在下文中一共展示了Form类的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createHeaderContents
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
@Override
protected void createHeaderContents(IManagedForm headerForm) {
super.createHeaderContents(headerForm);
FormToolkit toolkit = headerForm.getToolkit();
ScrolledForm scrolledForm = headerForm.getForm();
Form form = scrolledForm.getForm();
toolkit.decorateFormHeading(form);
updateTitle();
makeActions();
IToolBarManager toolBarManager = form.getToolBarManager();
contributeToToolBar(headerForm, toolBarManager);
toolBarManager.update(true);
}
示例2: modelDestroyed
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
protected void modelDestroyed(GenericDataModelEvent event) {
if (getContainer().isDisposed()) {
return;
}
updateTitle();
editorDirtyStateChanged();
String modelDestroyedMessage = getModelDestroyedMessage();
if (modelDestroyedMessage != null) {
IManagedForm headerForm = getHeaderForm();
ScrolledForm scrolledForm = headerForm.getForm();
Form form = scrolledForm.getForm();
form.setMessage(modelDestroyedMessage, IMessageProvider.ERROR);
}
for (DataModelFormPage<M> page : _Pages) {
page.modelDestroyed(event);
}
}
示例3: updateTitle
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
protected void updateTitle() {
M model = getModel();
if (model == null) {
return;
}
setPartName(getPartName(model));
setTitleToolTip(getTitleToolTip(model));
setTitleImage(getTitleImage(model));
IManagedForm headerForm = getHeaderForm();
if (headerForm != null) {
ScrolledForm scrolledForm = headerForm.getForm();
Form form = scrolledForm.getForm();
form.setText(getFormText(model));
form.setImage(getFormImage(model));
}
}
示例4: calculateMarginWidth
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
private static int calculateMarginWidth(final Control control) {
Control c = control;
int margin = 0;
while (c != null && !c.isDisposed() && !(c instanceof Form)) {
final int leftMargin = c.getBounds().x;
margin += leftMargin;
// assume there is an equal amount of right margin if not in a
// section.
if (!(c.getParent() instanceof Section)) {
margin += leftMargin;
}
c = c.getParent();
}
return margin;
}
示例5: createFormContent
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
/**
* @see org.eclipse.ui.forms.editor.FormPage#createFormContent(org.eclipse.ui.forms.IManagedForm)
*/
@Override
protected void createFormContent(final IManagedForm managedForm) {
final FormToolkit toolkit = managedForm.getToolkit();
final ScrolledForm scrolledForm = managedForm.getForm();
scrolledForm.setText(Messages.GeneratorEntryFormPage_formPageHeaderPrefix + getStatechartName());
final Form form = scrolledForm.getForm();
toolkit.decorateFormHeading(form);
final IToolBarManager toolBarManager = form.getToolBarManager();
toolBarManager.add(createGenerateAction());
form.updateToolBar();
final Composite body = scrolledForm.getBody();
body.setLayout(new TableWrapLayout());
createSections(toolkit, body);
startListeningToModelChanges();
}
示例6: createToolTipContentArea
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
@Override
protected Composite createToolTipContentArea(Event event, Composite parent){
FormToolkit toolkit = new FormToolkit(parent.getDisplay());
FormColors colors = toolkit.getColors();
Form form = toolkit.createForm(parent);
GridLayout layout = new GridLayout();
layout.numColumns = 1;
form.getBody().setLayout(layout);
FormText text = toolkit.createFormText(form.getBody(), true);
GridData td = new GridData();
td.heightHint = 200;
td.widthHint = 300;
text.setLayoutData(td);
try {
text.setText("<form>"+m_htmlString+"</form>", true, true);
} catch (IllegalArgumentException e) {
text.setText("<form><p>Fehlerhafter ToolTip Eingabestring</p><br /></form>", true, true);
}
return parent;
}
示例7: saveOrgUnitAttributes
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
/**
* {@inheritDoc}
*/
@Override
protected void saveOrgUnitAttributes() {
if (getTxtName() == null || getTxtDescription() == null) {
return;
}
if (group == null) {
return;
}
if (!(group.getName().equals(getTxtName().getText()) && group.getDescription().equals(
getTxtDescription().getText()))) {
try {
getAdminBroker().changeOrgUnit(group.getId(), getTxtName().getText(), getTxtDescription().getText());
((Form) getParent().getParent()).setText("Group: " + getTxtName().getText());
orgUnitMgmtGUI.getActiveTabContent().getTableViewer().refresh();
} catch (final ESException e) {
EMFStoreMessageDialog.showExceptionDialog(e);
}
}
}
示例8: configureFormText
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
private void configureFormText(final Form form, FormText text) {
text.addHyperlinkListener(new HyperlinkAdapter() {
@SuppressWarnings("unchecked")
public void linkActivated(HyperlinkEvent e) {
String is = (String) e.getHref();
try {
((FormText) e.widget).getShell().dispose();
int index = Integer.parseInt(is);
IMessage[] messages = form.getChildrenMessages();
IMessage message = messages[index];
Set<IvyNodeElement> conflicts = (Set<IvyNodeElement>) message.getData();
if (conflicts != null) {
viewer.setSelection(new StructuredSelection(new ArrayList<>(conflicts)));
}
} catch (NumberFormatException ex) {
}
}
});
text.setImage("error", getImage(IMessageProvider.ERROR));
text.setImage("warning", getImage(IMessageProvider.WARNING));
text.setImage("info", getImage(IMessageProvider.INFORMATION));
}
示例9: createFigure
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
* createFigure(org.eclipse.swt.widgets.Composite, org.eclipse.ui.forms.widgets.FormToolkit)
*
*/
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
view = form.getBody();
GridLayout layout = new GridLayout();
layout.numColumns = 3;
view.setLayout(layout);
createControls(widgetFactory, view);
return scrolledForm;
}
示例10: createFigure
import org.eclipse.ui.forms.widgets.Form; //导入依赖的package包/类
/**
* {@inheritDoc}
*
* @see org.eclipse.emf.eef.runtime.api.parts.IFormPropertiesEditionPart#
* createFigure(org.eclipse.swt.widgets.Composite,
* org.eclipse.ui.forms.widgets.FormToolkit)
*
*/
public Composite createFigure(final Composite parent, final FormToolkit widgetFactory) {
ScrolledForm scrolledForm = widgetFactory.createScrolledForm(parent);
Form form = scrolledForm.getForm();
view = form.getBody();
GridLayout layout = new GridLayout();
layout.numColumns = 3;
view.setLayout(layout);
createControls(widgetFactory, view);
return scrolledForm;
}