本文整理汇总了Java中org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil.setWidthHint方法的典型用法代码示例。如果您正苦于以下问题:Java LayoutUtil.setWidthHint方法的具体用法?Java LayoutUtil.setWidthHint怎么用?Java LayoutUtil.setWidthHint使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil
的用法示例。
在下文中一共展示了LayoutUtil.setWidthHint方法的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);
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;
}
示例2: 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);
}
示例3: 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;
}
示例4: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite) super.createDialogArea(parent);
initializeDialogUnits(parent);
GridLayout layout= (GridLayout) composite.getLayout();
layout.numColumns= 2;
fNameDialogField.doFillIntoGrid(composite, 3);
LayoutUtil.setHorizontalSpan(fNameDialogField.getLabelControl(null), 2);
int fieldWidthHint= convertWidthInCharsToPixels(60);
Text text= fNameDialogField.getTextControl(null);
LayoutUtil.setWidthHint(text, fieldWidthHint);
LayoutUtil.setHorizontalGrabbing(text);
TextFieldNavigationHandler.install(text);
DialogField.createEmptySpace(composite, 1);
fBrowseTypeButton.doFillIntoGrid(composite, 1);
fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());
applyDialogFont(composite);
return composite;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:27,代码来源:ImportOrganizeInputDialog.java
示例5: createModuleNameControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
protected void createModuleNameControls(Composite composite, int nColumns) {
moduleNameField.doFillIntoGrid(composite, nColumns - 1);
DialogField.createEmptySpace(composite);
Text moduleNameText = moduleNameField.getTextControl(null);
LayoutUtil.setWidthHint(moduleNameText, getMaxFieldWidth());
LayoutUtil.setHorizontalGrabbing(moduleNameText);
}
示例6: createPackageControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
protected void createPackageControls(Composite composite, int nColumns) {
modulePackageField.doFillIntoGrid(composite, nColumns);
Text modulePackageText = modulePackageField.getTextControl(null);
LayoutUtil.setWidthHint(modulePackageText, getMaxFieldWidth());
ControlContentAssistHelper.createTextContentAssistant(modulePackageText,
modulePackageCompletionProcessor);
TextFieldNavigationHandler.install(modulePackageText);
}
示例7: createFileControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
private void createFileControls(Composite parent, int nColumns) {
fileField = new StringButtonDialogField(fieldAdapter);
fileField.setLabelText("File:");
fileField.setButtonLabel("Browse...");
fileField.doFillIntoGrid(parent, nColumns);
Text text = fileField.getTextControl(null);
LayoutUtil.setWidthHint(text, getMaxFieldWidth());
LayoutUtil.setHorizontalGrabbing(fileField.getTextControl(null));
fileField.postSetFocusOnDialogField(parent.getDisplay());
}
示例8: createMethodNameControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
private void createMethodNameControls(Composite parent, int nColumns) {
methodNameField = new StringDialogField();
methodNameField.setLabelText("Method name:");
methodNameField.doFillIntoGrid(parent, nColumns - 1);
Text text = methodNameField.getTextControl(null);
LayoutUtil.setWidthHint(text, getMaxFieldWidth());
new Label(parent, SWT.NONE);
}
示例9: createResourceTypeControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
private void createResourceTypeControls(Composite parent, int nColumns) {
resourceTypeField = new StringButtonDialogField(fieldAdapter);
resourceTypeField.setLabelText("Resource type:");
resourceTypeField.setButtonLabel("Browse...");
resourceTypeField.doFillIntoGrid(parent, nColumns);
Text text = resourceTypeField.getTextControl(null);
LayoutUtil.setWidthHint(text, getMaxFieldWidth());
// Set up auto-completion
JavaTypeCompletionProcessor resourceTypeCompletionProcessor = new JavaTypeCompletionProcessorWithAutoActivation();
resourceTypeCompletionProcessor.setPackageFragment(pckgFragment);
ControlContentAssistHelper.createTextContentAssistant(text,
resourceTypeCompletionProcessor);
TextFieldNavigationHandler.install(text);
}
示例10: createClientBundleTypeControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
private void createClientBundleTypeControls(Composite parent, int nColumns) {
clientBundleTypeField = new StringButtonDialogField(fieldAdapter);
clientBundleTypeField.setLabelText("ClientBundle:");
clientBundleTypeField.setButtonLabel("Browse...");
clientBundleTypeField.doFillIntoGrid(parent, nColumns);
Text text = clientBundleTypeField.getTextControl(null);
LayoutUtil.setWidthHint(text, getMaxFieldWidth());
// Set up auto-completion
resourceTypeCompletionProcessor = new JavaTypeCompletionProcessorWithAutoActivation();
ControlContentAssistHelper.createTextContentAssistant(text,
resourceTypeCompletionProcessor);
TextFieldNavigationHandler.install(text);
}
示例11: createProjectControls
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
private void createProjectControls(Composite parent, int nColumns) {
projectField = new StringButtonDialogField(fieldAdapter);
projectField.setLabelText("Project:");
projectField.setButtonLabel("Browse...");
projectField.doFillIntoGrid(parent, nColumns);
Text text = projectField.getTextControl(null);
LayoutUtil.setWidthHint(text, getMaxFieldWidth());
LayoutUtil.setHorizontalGrabbing(projectField.getTextControl(null));
}
示例12: 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);
GridLayout layout= (GridLayout) composite.getLayout();
layout.numColumns= 3;
int widthHint= convertWidthInCharsToPixels(50);
GridData gd= new GridData(GridData.HORIZONTAL_ALIGN_FILL);
gd.horizontalSpan= 3;
// archive name field
fFileNameField.doFillIntoGrid(composite, 4);
LayoutUtil.setHorizontalSpan(fFileNameField.getLabelControl(null), 3);
LayoutUtil.setWidthHint(fFileNameField.getTextControl(null), widthHint);
LayoutUtil.setHorizontalGrabbing(fFileNameField.getTextControl(null));
// label that shows the resolved path for variable jars
//DialogField.createEmptySpace(composite, 1);
fFullPathResolvedLabel= new CLabel(composite, SWT.LEFT);
fFullPathResolvedLabel.setText(getResolvedLabelString());
fFullPathResolvedLabel.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL));
DialogField.createEmptySpace(composite, 2);
fFileNameField.postSetFocusOnDialogField(parent.getDisplay());
PlatformUI.getWorkbench().getHelpSystem().setHelp(composite, IJavaHelpContextIds.SOURCE_ATTACHMENT_BLOCK);
applyDialogFont(composite);
return composite;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:34,代码来源:EditVariableEntryDialog.java
示例13: 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);
inner.setFont(composite.getFont());
GridLayout layout= new GridLayout();
layout.marginHeight= 0;
layout.marginWidth= 0;
layout.numColumns= 2;
inner.setLayout(layout);
fMessageField.doFillIntoGrid(inner, 2);
if (fSubstitution.getState() == NLSSubstitution.EXTERNALIZED) {
fKeyField.doFillIntoGrid(inner, 2);
LayoutUtil.setWidthHint(fKeyField.getTextControl(null), convertWidthInCharsToPixels(45));
}
fValueField.doFillIntoGrid(inner, 2);
LayoutUtil.setWidthHint(fValueField.getTextControl(null), convertWidthInCharsToPixels(45));
LayoutUtil.setHorizontalGrabbing(fValueField.getTextControl(null));
fValueField.postSetFocusOnDialogField(parent.getDisplay());
applyDialogFont(composite);
return composite;
}
示例14: 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);
LayoutUtil.setWidthHint(text, textWidth);
LayoutUtil.setHorizontalGrabbing(text);
return res;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:10,代码来源:SourceFolderSelectionDialogButtonField.java
示例15: createDialogArea
import org.eclipse.jdt.internal.ui.wizards.dialogfields.LayoutUtil; //导入方法依赖的package包/类
@Override
protected Control createDialogArea(Composite parent) {
Composite composite= (Composite) super.createDialogArea(parent);
initializeDialogUnits(parent);
GridLayout layout= (GridLayout) composite.getLayout();
layout.numColumns= 2;
fNameDialogField.doFillIntoGrid(composite, 3);
fNameDialogField.getChangeControl(null).setVisible(!fIsEditingMember);
LayoutUtil.setHorizontalSpan(fNameDialogField.getLabelControl(null), 2);
int fieldWidthHint= convertWidthInCharsToPixels(60);
Text text= fNameDialogField.getTextControl(null);
LayoutUtil.setWidthHint(text, fieldWidthHint);
LayoutUtil.setHorizontalGrabbing(text);
LayoutUtil.setHorizontalSpan(text, fIsEditingMember ? 2 : 1);
TextFieldNavigationHandler.install(text);
DialogField.createEmptySpace(composite, 1);
fNameDialogField.postSetFocusOnDialogField(parent.getDisplay());
applyDialogFont(composite);
return composite;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:30,代码来源:CodeAssistFavoritesConfigurationBlock.java