本文整理汇总了Java中org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil类的典型用法代码示例。如果您正苦于以下问题:Java LayoutUtil类的具体用法?Java LayoutUtil怎么用?Java LayoutUtil使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LayoutUtil类属于org.eclipse.jdt.internal.ui.wizards.dialogfields包,在下文中一共展示了LayoutUtil类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite)super.createDialogArea(parent);
int widthHint= convertWidthInCharsToPixels(80);
Composite inner= new Composite(composite, SWT.NONE);
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= 1;
inner.setLayout(layout);
fContainerDialogField.doFillIntoGrid(inner, 2);
LayoutUtil.setWidthHint(fContainerDialogField.getLabelControl(null), widthHint);
LayoutUtil.setWidthHint(fContainerDialogField.getTextControl(null), widthHint);
LayoutUtil.setHorizontalGrabbing(fContainerDialogField.getTextControl(null));
fContainerDialogField.postSetFocusOnDialogField(parent.getDisplay());
applyDialogFont(composite);
return composite;
}
示例2: createAccessorPart
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
private void createAccessorPart(Composite parent, final int nOfColumns, int textWidth) {
createLabel(parent, NLSUIMessages.NLSAccessorConfigurationDialog_resourceBundle_title, nOfColumns);
fAccessorPackage.createControl(parent, nOfColumns, textWidth);
fAccessorClassName.doFillIntoGrid(parent, nOfColumns);
Text accessorClassText= fAccessorClassName.getTextControl(null);
LayoutUtil.setWidthHint(accessorClassText, convertWidthInCharsToPixels(60));
TextFieldNavigationHandler.install(accessorClassText);
fSubstitutionPattern.doFillIntoGrid(parent, nOfColumns);
Text substitutionPatternText= fSubstitutionPattern.getTextControl(null);
LayoutUtil.setWidthHint(substitutionPatternText, convertWidthInCharsToPixels(60));
TextFieldNavigationHandler.install(substitutionPatternText);
fSubstitutionPattern.setEnabled(!fRefactoring.isEclipseNLS());
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:NLSAccessorConfigurationDialog.java
示例3: doFillIntoGrid
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
public Control[] doFillIntoGrid(Composite parent, int nColumns, int textWidth) {
Control[] res= super.doFillIntoGrid(parent, nColumns);
final Text text= getTextControl(null);
text.addModifyListener(new ModifyListener() {
public void modifyText(ModifyEvent e) {
updateListener();
}
});
LayoutUtil.setWidthHint(text, textWidth);
LayoutUtil.setHorizontalGrabbing(text);
ControlContentAssistHelper.createTextContentAssistant(text, fCurrPackageCompletionProcessor);
TextFieldNavigationHandler.install(text);
return res;
}
示例4: createContent
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
public Control createContent(Composite composite) {
fGroup= new Group(composite, SWT.NONE);
fGroup.setFont(composite.getFont());
fGroup.setLayout(initGridLayout(new GridLayout(3, false), true));
fGroup.setText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_title);
fStdRadio.doFillIntoGrid(fGroup, 3);
LayoutUtil.setHorizontalGrabbing(fStdRadio.getSelectionButton(null));
fSrcBinRadio.doFillIntoGrid(fGroup, 2);
fPreferenceLink= new Link(fGroup, SWT.NONE);
fPreferenceLink.setText(NewWizardMessages.NewJavaProjectWizardPageOne_LayoutGroup_link_description);
fPreferenceLink.setLayoutData(new GridData(GridData.END, GridData.END, false, false));
fPreferenceLink.addSelectionListener(this);
updateEnableState();
return fGroup;
}
示例5: createModifierControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
/**
* Creates the controls for the modifiers radio/checkbox buttons. Expects a
* <code>GridLayout</code> with at least 3 columns.
*
* @param composite the parent composite
* @param nColumns number of columns to span
*/
protected void createModifierControls(Composite composite, int nColumns) {
LayoutUtil.setHorizontalSpan(fAccMdfButtons.getLabelControl(composite), 1);
Control control= fAccMdfButtons.getSelectionButtonsGroup(composite);
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= nColumns - 2;
control.setLayoutData(gd);
DialogField.createEmptySpace(composite);
if (fTypeKind == CLASS_TYPE) {
DialogField.createEmptySpace(composite);
control= fOtherMdfButtons.getSelectionButtonsGroup(composite);
gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= nColumns - 2;
control.setLayoutData(gd);
DialogField.createEmptySpace(composite);
}
}
示例6: createSuperClassControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
/**
* Creates the controls for the superclass name field. Expects a <code>GridLayout</code>
* with at least 3 columns.
*
* @param composite the parent composite
* @param nColumns number of columns to span
*/
protected void createSuperClassControls(Composite composite, int nColumns) {
fSuperClassDialogField.doFillIntoGrid(composite, nColumns);
Text text= fSuperClassDialogField.getTextControl(null);
LayoutUtil.setWidthHint(text, getMaxFieldWidth());
BidiUtils.applyBidiProcessing(text, StructuredTextTypeHandlerFactory.JAVA);
JavaTypeCompletionProcessor superClassCompletionProcessor= new JavaTypeCompletionProcessor(false, false, true);
superClassCompletionProcessor.setCompletionContextRequestor(new CompletionContextRequestor() {
@Override
public StubTypeContext getStubTypeContext() {
return getSuperClassStubTypeContext();
}
});
ControlContentAssistHelper.createTextContentAssistant(text, superClassCompletionProcessor);
TextFieldNavigationHandler.install(text);
}
示例7: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
initializeDialogUnits(parent);
Composite composite= (Composite) super.createDialogArea(parent);
Composite inner= new Composite(composite, SWT.NONE);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
inner.setFont(composite.getFont());
LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList }, true, 0, 0);
LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));
applyDialogFont(composite);
return composite;
}
示例8: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
initializeDialogUnits(parent);
Composite composite= (Composite) super.createDialogArea(parent);
Composite inner= new Composite(composite, SWT.NONE);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
inner.setFont(composite.getFont());
LayoutUtil.doDefaultLayout(inner, new DialogField[] { fHistoryList, new Separator() }, true);
LayoutUtil.setHeightHint(fHistoryList.getListControl(null), convertHeightInCharsToPixels(12));
LayoutUtil.setHorizontalGrabbing(fHistoryList.getListControl(null));
Composite additionalControls= new Composite(inner, SWT.NONE);
additionalControls.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
LayoutUtil.doDefaultLayout(additionalControls, new DialogField[] { fMaxEntriesField }, false);
LayoutUtil.setHorizontalGrabbing(fMaxEntriesField.getTextControl(null));
applyDialogFont(composite);
return composite;
}
示例9: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite) super.createDialogArea(parent);
Composite inner= new Composite(composite, SWT.NONE);
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= 2;
inner.setLayout(layout);
fNameDialogField.doFillIntoGrid(inner, 2);
fPriorityDialogField.doFillIntoGrid(inner, 2);
LayoutUtil.setHorizontalGrabbing(fNameDialogField.getTextControl(null));
LayoutUtil.setWidthHint(fNameDialogField.getTextControl(null), convertWidthInCharsToPixels(45));
fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());
applyDialogFont(composite);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.TASK_TAG_INPUT_DIALOG);
return composite;
}
示例10: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite) super.createDialogArea(parent);
Composite inner= new Composite(composite, SWT.NONE);
LayoutUtil.doDefaultLayout(inner, new DialogField[] { fNameDialogField }, true, 0, 0);
int fieldWidthHint= convertWidthInCharsToPixels(60);
Text text= fNameDialogField.getTextControl(null);
LayoutUtil.setWidthHint(text, fieldWidthHint);
LayoutUtil.setHorizontalGrabbing(text);
BidiUtils.applyBidiProcessing(text, StructuredTextTypeHandlerFactory.JAVA);
TextFieldNavigationHandler.install(text);
fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());
applyDialogFont(composite);
return composite;
}
示例11: createFavoriteList
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
private void createFavoriteList(Composite parent) {
String[] buttonLabels= new String[] {
PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_newType_button,
PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_newMember_button,
PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_edit_button,
PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_remove_button
};
ListAdapter adapter= new ListAdapter();
fList= new ListDialogField<String>(adapter, buttonLabels, new ListLabelProvider());
fList.setDialogFieldListener(adapter);
fList.setLabelText(PreferencesMessages.CodeAssistStaticMembersConfigurationBlock_description);
fList.setRemoveButtonIndex(IDX_REMOVE);
fList.enableButton(IDX_EDIT, false);
fList.setViewerComparator(new ViewerComparator());
PixelConverter pixelConverter= new PixelConverter(parent);
fList.doFillIntoGrid(parent, 3);
LayoutUtil.setHorizontalSpan(fList.getLabelControl(null), 2);
LayoutUtil.setWidthHint(fList.getLabelControl(null), pixelConverter.convertWidthInCharsToPixels(60));
LayoutUtil.setHorizontalGrabbing(fList.getListControl(null));
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:25,代码来源:CodeAssistFavoritesConfigurationBlock.java
示例12: addLink
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
private void addLink(Composite composite, String text) {
GridData gd;
final Link link= new Link(composite, SWT.NONE);
link.setText(text);
gd= new GridData(SWT.FILL, SWT.BEGINNING, true, false);
gd.widthHint= 300; // don't get wider initially
gd.horizontalSpan= 2;
gd.horizontalIndent= LayoutUtil.getIndent();
link.setLayoutData(gd);
link.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
PreferencesUtil.createPreferenceDialogOn(link.getShell(), e.text, null, null);
}
});
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:17,代码来源:JavaEditorAppearanceConfigurationBlock.java
示例13: createControl
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
public void createControl(Composite parent) {
Composite inner= new Composite(parent, SWT.NONE);
inner.setFont(parent.getFont());
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= 2;
inner.setLayout(layout);
inner.setLayoutData(new GridData(GridData.FILL_BOTH));
fInclusionPatternList.doFillIntoGrid(inner, 3);
LayoutUtil.setHorizontalSpan(fInclusionPatternList.getLabelControl(null), 2);
LayoutUtil.setHorizontalGrabbing(fInclusionPatternList.getListControl(null));
fExclusionPatternList.doFillIntoGrid(inner, 3);
LayoutUtil.setHorizontalSpan(fExclusionPatternList.getLabelControl(null), 2);
LayoutUtil.setHorizontalGrabbing(fExclusionPatternList.getListControl(null));
setControl(inner);
Dialog.applyDialogFont(inner);
PlatformUI.getWorkbench().getHelpSystem().setHelp(inner, IJavaHelpContextIds.INCLUSION_EXCLUSION_WIZARD_PAGE);
}
示例14: createContents
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
@Override
protected Control createContents(Composite parent) {
fPixelConverter= new PixelConverter(parent);
setShell(parent.getShell());
Composite composite= new Composite(parent, SWT.NONE);
composite.setFont(parent.getFont());
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= 2;
composite.setLayout(layout);
fCodeTemplateTree.doFillIntoGrid(composite, 3);
LayoutUtil.setHorizontalSpan(fCodeTemplateTree.getLabelControl(null), 2);
LayoutUtil.setHorizontalGrabbing(fCodeTemplateTree.getTreeControl(null));
fPatternViewer= createViewer(composite, 2);
fGenerateComments.doFillIntoGrid(composite, 2);
return composite;
}
示例15: createControl
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入依赖的package包/类
public void createControl(Composite parent) {
initializeDialogUnits(parent);
Composite composite= new Composite(parent, SWT.NONE);
GridLayout layout= new GridLayout();
layout.numColumns= 3;
composite.setLayout(layout);
fProjectField.doFillIntoGrid(composite, 3);
fRootDialogField.doFillIntoGrid(composite, 3);
fExcludeInOthersFields.doFillIntoGrid(composite, 3);
fIgnoreOptionalProblemsField.doFillIntoGrid(composite, 3);
int maxFieldWidth= convertWidthInCharsToPixels(40);
LayoutUtil.setWidthHint(fProjectField.getTextControl(null), maxFieldWidth);
LayoutUtil.setHorizontalGrabbing(fProjectField.getTextControl(null));
LayoutUtil.setWidthHint(fRootDialogField.getTextControl(null), maxFieldWidth);
BidiUtils.applyBidiProcessing(fRootDialogField.getTextControl(null), StructuredTextTypeHandlerFactory.FILE);
setControl(composite);
Dialog.applyDialogFont(composite);
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.NEW_PACKAGEROOT_WIZARD_PAGE);
}