本文整理匯總了Java中org.eclipse.jface.preference.DirectoryFieldEditor.getTextControl方法的典型用法代碼示例。如果您正苦於以下問題:Java DirectoryFieldEditor.getTextControl方法的具體用法?Java DirectoryFieldEditor.getTextControl怎麽用?Java DirectoryFieldEditor.getTextControl使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.preference.DirectoryFieldEditor
的用法示例。
在下文中一共展示了DirectoryFieldEditor.getTextControl方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createUI_94_Field_RawDataPath
import org.eclipse.jface.preference.DirectoryFieldEditor; //導入方法依賴的package包/類
/**
* field: path to save raw tour data
*/
private void createUI_94_Field_RawDataPath(final Composite parent) {
/*
* editor: raw data path
*/
_rawDataPathEditor = new DirectoryFieldEditor(
ITourbookPreferences.DUMMY_FIELD,
Messages.Pref_People_Label_DefaultDataTransferFilePath,
parent);
_rawDataPathEditor.setEmptyStringAllowed(true);
_rawDataPathEditor.setValidateStrategy(StringFieldEditor.VALIDATE_ON_KEY_STROKE);
final Label lblPath = _rawDataPathEditor.getLabelControl(parent);
lblPath.setToolTipText(Messages.Pref_People_Label_DefaultDataTransferFilePath_Tooltip);
_txtRawDataPath = _rawDataPathEditor.getTextControl(parent);
_txtRawDataPath.addModifyListener(_defaultModifyListener);
}
示例2: createDefaults
import org.eclipse.jface.preference.DirectoryFieldEditor; //導入方法依賴的package包/類
private void createDefaults(Composite parent) {
GridData groupLayoutData = new GridData();
groupLayoutData.horizontalAlignment = GridData.FILL;
groupLayoutData.verticalAlignment = GridData.BEGINNING;
groupLayoutData.grabExcessHorizontalSpace = true;
groupLayoutData.grabExcessVerticalSpace = false;
groupLayoutData.verticalSpan = 2;
groupLayoutData.horizontalSpan = 3;
Group defaultGroup = SWTFactory.createGroup(parent, "", 1, 10, SWT.FILL);
defaultGroup.setLayoutData(groupLayoutData);
rootPathDirectoryEditor = new DirectoryFieldEditor(P_ROOTPROJECT_PATH.getId(), "&Gradle root project path",
defaultGroup);
addField(rootPathDirectoryEditor);
GridData directoryTextLayout = new GridData(SWT.FILL,SWT.TOP,true,false);
String rootPathTooltipText = "Default root path. Can be overriden in launch configurations";
rootPathDirectoryEditor.getLabelControl(defaultGroup).setToolTipText(rootPathTooltipText);
Text rootPathTextControl = rootPathDirectoryEditor.getTextControl(defaultGroup);
rootPathTextControl.setToolTipText(rootPathTooltipText);
rootPathTextControl.setLayoutData(directoryTextLayout);
rootPathDirectoryEditor.setEmptyStringAllowed(false);
if (! mode.isRootPathDirectoryEditable()){
rootPathDirectoryEditor.setEnabled(false, defaultGroup);
}
/* java home default */
defaultJavaHomeDirectoryEditor = new DirectoryFieldEditor(P_JAVA_HOME_PATH.getId(), "&JAVA HOME (optional)",
defaultGroup);
defaultJavaHomeDirectoryEditor.setEmptyStringAllowed(true);
String defaultJavaHomeDirectoryTooltipText = "A default global JAVA_HOME path. Can be overriden in launch configurations";
defaultJavaHomeDirectoryEditor.getLabelControl(defaultGroup)
.setToolTipText(defaultJavaHomeDirectoryTooltipText);
Text javaHomeTextControl = defaultJavaHomeDirectoryEditor.getTextControl(defaultGroup);
javaHomeTextControl.setToolTipText(defaultJavaHomeDirectoryTooltipText);
javaHomeTextControl.setLayoutData(directoryTextLayout);
addField(defaultJavaHomeDirectoryEditor);
/* restore meta data */
if (mode.isRestoreMetaDataCheckBoxNeeded()) {
restoreMetaDataCheckbox = SWTFactory.createCheckButton(defaultGroup, "Restore former meta data (e.g. Team provider data)", null, true, SWT.LEFT);
}
}
示例3: createUI_10_OfflineFolder
import org.eclipse.jface.preference.DirectoryFieldEditor; //導入方法依賴的package包/類
private void createUI_10_OfflineFolder(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText(Messages.Pref_Map25_Offline_Group_OfflineMap);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
{
/*
* field: use default location
*/
_editorBool_UseDefaultLocation = new BooleanFieldEditor(
ITourbookPreferences.MAP25_OFFLINE_MAP_IS_DEFAULT_LOCATION,
Messages.Pref_Map25_Offline_Checkbox_UseDefaultLocation,
group);
_editorBool_UseDefaultLocation.setPage(this);
_editorBool_UseDefaultLocation.setPreferenceStore(_prefStore);
addField(_editorBool_UseDefaultLocation);
// spacer
new Label(group, SWT.NONE);
_editorContainerLocation = new Composite(group, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(_editorContainerLocation);
{
/*
* editor: thumbnail location
*/
_editorDir_ThumbnailLocation = new DirectoryFieldEditor(
ITourbookPreferences.MAP25_OFFLINE_MAP_CUSTOM_LOCATION,
Messages.Pref_Map25_Offline_Label_Location,
_editorContainerLocation);
_editorDir_ThumbnailLocation.setPage(this);
_editorDir_ThumbnailLocation.setPreferenceStore(_prefStore);
_editorDir_ThumbnailLocation.setEmptyStringAllowed(false);
final Text textDirEditor = _editorDir_ThumbnailLocation.getTextControl(_editorContainerLocation);
textDirEditor.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
_isModified = true;
isDataValid();
}
});
addField(_editorDir_ThumbnailLocation);
}
}
// !!! set layout after the editor was created because the editor sets the parents layout
GridLayoutFactory.swtDefaults().numColumns(3).applyTo(group);
}
示例4: createUI_10_StoreLocation
import org.eclipse.jface.preference.DirectoryFieldEditor; //導入方法依賴的package包/類
private void createUI_10_StoreLocation(final Composite parent) {
final Group group = new Group(parent, SWT.NONE);
group.setText(Messages.PrefPage_Photo_ThumbStore_Group_ThumbnailStoreLocation);
GridDataFactory.fillDefaults().grab(true, false).applyTo(group);
{
/*
* field: use default location
*/
_editorBoolUseDefaultLocation = new BooleanFieldEditor(
IPhotoPreferences.PHOTO_THUMBNAIL_STORE_IS_DEFAULT_LOCATION,
Messages.PrefPage_Photo_ThumbStore_Checkbox_UseDefaultLocation,
group);
_editorBoolUseDefaultLocation.setPage(this);
_editorBoolUseDefaultLocation.setPreferenceStore(_prefStore);
addField(_editorBoolUseDefaultLocation);
// spacer
new Label(group, SWT.NONE);
_containerLocation = new Composite(group, SWT.NONE);
GridDataFactory.fillDefaults().grab(true, false).span(3, 1).applyTo(_containerLocation);
{
/*
* editor: thumbnail location
*/
_editorDirThumbnailLocation = new DirectoryFieldEditor(
IPhotoPreferences.PHOTO_THUMBNAIL_STORE_CUSTOM_LOCATION,
Messages.PrefPage_Photo_ThumbStore_Text_Location,
_containerLocation);
_editorDirThumbnailLocation.setPage(this);
_editorDirThumbnailLocation.setPreferenceStore(_prefStore);
_editorDirThumbnailLocation.setEmptyStringAllowed(false);
final Text textDirEditor = _editorDirThumbnailLocation.getTextControl(_containerLocation);
textDirEditor.addModifyListener(new ModifyListener() {
@Override
public void modifyText(final ModifyEvent e) {
isDataValid();
}
});
addField(_editorDirThumbnailLocation);
}
}
// !!! set layout after the editor was created because the editor sets the parents layout
GridLayoutFactory.swtDefaults().numColumns(3).applyTo(group);
}