本文整理汇总了Java中org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField类的典型用法代码示例。如果您正苦于以下问题:Java ListDialogField类的具体用法?Java ListDialogField怎么用?Java ListDialogField使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ListDialogField类属于org.eclipse.jdt.internal.ui.wizards.dialogfields包,在下文中一共展示了ListDialogField类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: customButtonPressed
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
public void customButtonPressed(ListDialogField<ClientBundleResource> field, int index) {
List<ClientBundleResource> resourcesBefore = resourcesField.getElements();
switch (index) {
case IDX_ADD:
addResource();
break;
case IDX_ADD_MULTIPLE:
addMultipleResources();
break;
case IDX_EDIT:
editSelectedResource();
break;
case IDX_REMOVE:
removeSelectedResources();
break;
}
// Notify the listener if our list of modules changes
if (listener != null && !getResources().equals(resourcesBefore)) {
listener.onResourcesChanged();
}
}
示例2: createListField
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private void createListField() {
String[] buttons = new String[] {
"Add...", "Add Multiple...", "Edit", null, "Remove", null};
resourcesField =
new ListDialogField<ClientBundleResource>(new SelectionAdapter(), buttons,
new ColumnLabelProvider());
resourcesField.setLabelText(labelText);
String[] columnNames = {"File", "Type", "Method name"};
ColumnLayoutData[] columnLayouts = {
new ColumnPixelData(100), new ColumnPixelData(100),
new ColumnPixelData(100)};
resourcesField.setTableColumns(new ListDialogField.ColumnsDescription(
columnLayouts, columnNames, false));
// Edit and Remove buttons disabled by default
resourcesField.enableButton(IDX_EDIT, false);
resourcesField.enableButton(IDX_REMOVE, false);
}
示例3: createListContents
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private ListDialogField<String> createListContents(CPListElement entryToEdit, String key, String label, ImageDescriptor descriptor, String[] buttonLabels) {
ExclusionPatternAdapter adapter= new ExclusionPatternAdapter();
ListDialogField<String> patternList= new ListDialogField<String>(adapter, buttonLabels, new ExclusionInclusionLabelProvider(descriptor));
patternList.setDialogFieldListener(adapter);
patternList.setLabelText(label);
patternList.setRemoveButtonIndex(IDX_REMOVE);
patternList.enableButton(IDX_EDIT, false);
IPath[] pattern= (IPath[]) entryToEdit.getAttribute(key);
ArrayList<String> elements= new ArrayList<String>(pattern.length);
for (int i= 0; i < pattern.length; i++) {
elements.add(pattern[i].toString());
}
patternList.setElements(elements);
patternList.selectFirstElement();
patternList.enableButton(IDX_ADD_MULTIPLE, fCurrSourceFolder != null);
patternList.setViewerComparator(new ViewerComparator());
return patternList;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:22,代码来源:ExclusionInclusionDialog.java
示例4: createListDialogField
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private void createListDialogField(Composite composite, ListDialogField<String> dialogField) {
Control list= dialogField.getListControl(composite);
GridData gd= new GridData();
gd.horizontalAlignment= GridData.FILL;
gd.grabExcessHorizontalSpace= true;
gd.verticalAlignment= GridData.FILL;
gd.grabExcessVerticalSpace= true;
gd.widthHint= convertWidthInCharsToPixels(50);
list.setLayoutData(gd);
Composite buttons= dialogField.getButtonBox(composite);
gd= new GridData();
gd.horizontalAlignment= GridData.FILL;
gd.grabExcessHorizontalSpace= false;
gd.verticalAlignment= GridData.FILL;
gd.grabExcessVerticalSpace= true;
buttons.setLayoutData(gd);
}
示例5: createFavoriteList
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的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-Juno38,代码行数:25,代码来源:CodeAssistFavoritesConfigurationBlock.java
示例6: ProjectsWorkbookPage
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
public ProjectsWorkbookPage(ListDialogField<CPListElement> classPathList, IWorkbenchPreferenceContainer pageContainer) {
fClassPathList= classPathList;
fPageContainer= pageContainer;
fSWTControl= null;
String[] buttonLabels= new String[] {
NewWizardMessages.ProjectsWorkbookPage_projects_add_button,
null,
NewWizardMessages.ProjectsWorkbookPage_projects_edit_button,
NewWizardMessages.ProjectsWorkbookPage_projects_remove_button
};
ProjectsAdapter adapter= new ProjectsAdapter();
fProjectsList= new TreeListDialogField<CPListElement>(adapter, buttonLabels, new CPListLabelProvider());
fProjectsList.setDialogFieldListener(adapter);
fProjectsList.setLabelText(NewWizardMessages.ProjectsWorkbookPage_projects_label);
fProjectsList.enableButton(IDX_REMOVE, false);
fProjectsList.enableButton(IDX_EDIT, false);
fProjectsList.setViewerComparator(new CPListElementSorter());
}
示例7: createListContents
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private ListDialogField<String> createListContents(CPListElement entryToEdit, String key, String label, ImageDescriptor descriptor, String[] buttonLabels) {
ExclusionPatternAdapter adapter= new ExclusionPatternAdapter();
ListDialogField<String> patternList= new ListDialogField<String>(adapter, buttonLabels, new ExclusionInclusionLabelProvider(descriptor));
patternList.setDialogFieldListener(adapter);
patternList.setLabelText(label);
patternList.enableButton(IDX_EDIT, false);
IPath[] pattern= (IPath[]) entryToEdit.getAttribute(key);
ArrayList<String> elements= new ArrayList<String>(pattern.length);
for (int i= 0; i < pattern.length; i++) {
String patternName= pattern[i].toString();
if (patternName.length() > 0)
elements.add(patternName);
}
patternList.setElements(elements);
patternList.selectFirstElement();
patternList.enableButton(IDX_ADD_MULTIPLE, fCurrSourceFolder != null);
patternList.setViewerComparator(new ViewerComparator());
return patternList;
}
示例8: addMultipleEntries
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private void addMultipleEntries(ListDialogField<String> field) {
String title, message;
if (isExclusion(field)) {
title= NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_title;
message= NewWizardMessages.ExclusionInclusionDialog_ChooseExclusionPattern_description;
} else {
title= NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_title;
message= NewWizardMessages.ExclusionInclusionDialog_ChooseInclusionPattern_description;
}
IPath[] res= ExclusionInclusionEntryDialog.chooseExclusionPattern(getShell(), fCurrSourceFolder, title, message, null, true);
if (res != null) {
for (int i= 0; i < res.length; i++) {
field.addElement(res[i].toString());
}
}
}
示例9: selectionChanged
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
@Override
public void selectionChanged(ListDialogField<IProject> field)
{
List<IProject> elements = fProject.getSelectedElements();
if( elements.isEmpty() )
{
selected = null;
}
else
{
selected = elements.get(0);
}
}
示例10: createExcludedJarsComponent
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private void createExcludedJarsComponent(Composite parent) {
excludedJarsComponent = new Composite(parent, SWT.NONE);
GridData excludedJarsComponentGridData = new GridData(GridData.FILL_BOTH);
excludedJarsComponentGridData.horizontalSpan = ((GridLayout) parent.getLayout()).numColumns;
excludedJarsComponentGridData.grabExcessVerticalSpace = true;
excludedJarsComponent.setLayoutData(excludedJarsComponentGridData);
GridLayout containerGridLayout = new GridLayout(3, false);
containerGridLayout.marginTop = 16;
excludedJarsComponent.setLayout(containerGridLayout);
Label label = new Label(excludedJarsComponent, SWT.NONE);
GridData labelGridData = new GridData(GridData.FILL_HORIZONTAL);
labelGridData.horizontalSpan = 3;
label.setLayoutData(labelGridData);
label.setText("Suppress warnings about these build path entries being outside of WEB-INF/lib:");
String[] buttons = new String[] { "Add...", null, "Remove" };
excludedJarsField = new ListDialogField(new ExcludedJarSelectionAdapter(), buttons, new ExcludedJarLabelProvider());
ColumnLayoutData[] columns = new ColumnLayoutData[] { new ColumnWeightData(1, 100, true),
new ColumnWeightData(2, 100, true) };
String[] columnHeaderNames = { "JAR file", "Location" };
excludedJarsField.setTableColumns(new ListDialogField.ColumnsDescription(columns, columnHeaderNames, false));
excludedJarsField.setRemoveButtonIndex(IDX_REMOVE);
excludedJarsField.doFillIntoGrid(excludedJarsComponent, 3);
GridData layoutData = (GridData) excludedJarsField.getListControl(excludedJarsComponent).getLayoutData();
layoutData.grabExcessHorizontalSpace = true;
layoutData.grabExcessVerticalSpace = true;
excludedJarsField.getListControl(excludedJarsComponent).setLayoutData(layoutData);
}
示例11: customButtonPressed
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
@Override
public void customButtonPressed(ListDialogField<String> field, int index) {
List<String> beforeModules = modulesField.getElements();
if (index == IDX_ADD) {
addEntry();
} else if (index == IDX_REMOVE) {
removeSelectedEntries();
} else if (index == IDX_SET_DEFAULTS) {
setDefaults();
}
// Notify the listener if our list of modules changes
notifyListenerIfChanged(beforeModules);
}
示例12: createListField
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
private void createListField() {
String[] buttons = new String[] {"Add...", "Remove", null, "Restore Defaults"};
modulesField = new ListDialogField<String>(new ModulesSelectionAdapter(), buttons, new ModulesLabelProvider());
modulesField.setLabelText(labelText);
modulesField.setTableColumns(new ListDialogField.ColumnsDescription(1, false));
// Remove button disabled by default
modulesField.enableButton(IDX_REMOVE, false);
}
示例13: customButtonPressed
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
public void customButtonPressed(ListDialogField<IModule> field, int index) {
if (index == ADD_INHERITS_BUTTON_GROUP_INDEX) {
moduleAddInheritsButtonPressed();
} else {
moduleRemoveInheritsButtonPressed();
}
}
示例14: NewModuleWizardPage
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
public NewModuleWizardPage() {
super("newModuleWizardPage");
setTitle("New GWT Module");
setDescription("Create a new GWT Module.");
ModuleDialogFieldAdapter adapter = new ModuleDialogFieldAdapter();
modulePackageField = new StringButtonStatusDialogField(adapter);
modulePackageField.setDialogFieldListener(adapter);
modulePackageField.setLabelText("Package:");
modulePackageField.setButtonLabel(NewWizardMessages.NewTypeWizardPage_package_button);
modulePackageField.setStatusWidthHint(NewWizardMessages.NewTypeWizardPage_default);
modulePackageCompletionProcessor = new JavaPackageCompletionProcessor();
moduleNameField = new StringDialogField();
moduleNameField.setDialogFieldListener(adapter);
moduleNameField.setLabelText("Module name:");
String[] addButtons = new String[] {
NewWizardMessages.NewTypeWizardPage_interfaces_add,
/* 1 */null, NewWizardMessages.NewTypeWizardPage_interfaces_remove};
moduleInheritsDialogField =
new ListDialogField<IModule>(adapter, addButtons,
new ModuleSelectionLabelProvider());
moduleInheritsDialogField.setDialogFieldListener(adapter);
moduleInheritsDialogField.setTableColumns(new ListDialogField.ColumnsDescription(
1, false));
moduleInheritsDialogField.setLabelText("Inherited modules:");
moduleInheritsDialogField.setRemoveButtonIndex(REMOVE_INHERITS_BUTTON_GROUP_INDEX);
String[] buttonNames = new String[] {
"Create public resource path", "Create package for client source"};
moduleCreateElementsCheckboxes = new SelectionButtonDialogFieldGroup(
SWT.CHECK, buttonNames, 1);
moduleContainerStatus = new StatusInfo();
modulePackageStatus = new StatusInfo();
moduleNameStatus = new StatusInfo();
}
示例15: createPreferenceList
import org.eclipse.jdt.internal.ui.wizards.dialogfields.ListDialogField; //导入依赖的package包/类
/**
* Create a list dialog field.
*
* @param parent the composite
*/
private void createPreferenceList(Composite parent) {
String[] buttonLabels= new String[] {
CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_newType_button,
CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_newMember_button,
CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_edit_button,
CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_remove_button,
CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_restoreDefaults_button
};
ListAdapter adapter= new ListAdapter();
fList= new ListDialogField<String>(adapter, buttonLabels, new ListLabelProvider());
fList.setDialogFieldListener(adapter);
fList.setLabelText(CallHierarchyMessages.ExpandWithConstructorsConfigurationBlock_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));
Control listControl= fList.getListControl(null);
GridData gd= (GridData)listControl.getLayoutData();
gd.verticalAlignment= GridData.FILL;
gd.grabExcessVerticalSpace= true;
gd.heightHint= pixelConverter.convertHeightInCharsToPixels(10);
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion,代码行数:37,代码来源:ExpandWithConstructorsConfigurationBlock.java