本文整理匯總了Java中org.eclipse.jface.viewers.ListViewer.getList方法的典型用法代碼示例。如果您正苦於以下問題:Java ListViewer.getList方法的具體用法?Java ListViewer.getList怎麽用?Java ListViewer.getList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.eclipse.jface.viewers.ListViewer
的用法示例。
在下文中一共展示了ListViewer.getList方法的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createDialogArea
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
@Override
protected Control createDialogArea(Composite container) {
Composite parent = (Composite) super.createDialogArea(container);
listViewer = new ListViewer(parent);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.heightHint = convertHeightInCharsToPixels(15);
gd.widthHint = convertWidthInCharsToPixels(55);
org.eclipse.swt.widgets.List list = listViewer.getList();
list.setLayoutData(gd);
list.setFont(container.getFont());
if (values != null){
list.setItems(values);
}
if (list.getItemCount() > 0){
list.select(list.getItemCount() - 1);
}
addButtons(parent);
return parent;
}
示例2: createDialogArea
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
/**
* Create contents of the dialog.
* @param parent
*/
@Override
protected Control createDialogArea(Composite parent) {
setTitle(title);
setMessage("Select a class.", IMessageProvider.INFORMATION);
Composite container = (Composite) super.createDialogArea(parent);
container.setLayout(new GridLayout(1, false));
listViewer = new ListViewer(container, SWT.BORDER | SWT.V_SCROLL);
list = listViewer.getList();
list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
initValues();
return container;
}
示例3: createDialogArea
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
/**
*
* {@inheritDoc}
*
* @see org.eclipse.jface.dialogs.TitleAreaDialog#createDialogArea(org.eclipse.swt.widgets.Composite)
*/
@Override
protected Control createDialogArea(Composite parent) {
setMessage("In order to execute your requested operation, you have to select a server.");
setTitle("Please select a Server");
final Composite area = (Composite) super.createDialogArea(parent);
final Composite container = new Composite(area, SWT.NONE);
container.setLayout(new GridLayout(1, false));
container.setLayoutData(new GridData(GridData.FILL_BOTH));
listViewer = new ListViewer(container, SWT.BORDER | SWT.V_SCROLL);
final List list = listViewer.getList();
list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
listViewer.setContentProvider(ArrayContentProvider.getInstance());
labelProvider = new ServerInfoLabelProvider();
listViewer.setLabelProvider(labelProvider);
listViewer.setInput(servers);
if (servers.size() == 1) {
listViewer.setSelection(new StructuredSelection(servers.get(0)));
}
return area;
}
示例4: createChartsComposite
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
private void createChartsComposite (Composite container)
{
Group grpResources = new Group(container, SWT.NONE);
grpResources.setText("Resources");
grpResources.setLayout(new FillLayout(SWT.HORIZONTAL));
SashForm sashResources = new SashForm(grpResources, SWT.HORIZONTAL | SWT.SMOOTH);
sashResources.setSashWidth(8);
listViewer = new ListViewer(sashResources, SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
listResources = listViewer.getList();// new List(sashResources,
// SWT.BORDER | SWT.H_SCROLL |
// SWT.V_SCROLL);
listViewer.setContentProvider(new ArrayContentProvider());
listViewer.setLabelProvider(new LabelProvider()
{
@Override
public String getText(Object element)
{
return element.toString().replaceFirst("-org.spotter.demo.app.", "");
}
});
canvasRes = new Canvas(sashResources, SWT.NONE);
sashResources.setWeights(new int[] {3, 7});
addCanvasListeners();
}
示例5: WTimeZoneList
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
/**
* Create an instance of WTimeZoneList, a single select list of available time zones.
* @param parent
* @param style
*/
public WTimeZoneList(Composite parent, int style) {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
listViewer = new ListViewer(this, SWT.BORDER | SWT.V_SCROLL);
list = listViewer.getList();
timeZonesIDs = TimeZone.getAvailableIDs();
initList();
}
示例6: WLocaleList
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
/**
* Create an instance of WLocaleList, a single select list of available locales.
*
* @param parent
* @param style
*/
public WLocaleList(Composite parent, int style) {
super(parent, style);
setLayout(new FillLayout(SWT.HORIZONTAL));
listViewer = new ListViewer(this, SWT.BORDER | SWT.V_SCROLL);
list = listViewer.getList();
locales = Locale.getAvailableLocales();
initList();
}
示例7: createPartControl
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
@Override
public void createPartControl(Composite parent) {
parent.setLayout(new GridLayout(3, false));
Label lblProject = new Label(parent, SWT.NONE);
lblProject.setLayoutData(new GridData(SWT.RIGHT, SWT.CENTER, false, false, 1, 1));
lblProject.setText("Project");
cProjects = new Combo(parent, SWT.NONE);
cProjects.setLayoutData(new GridData(SWT.FILL, SWT.CENTER, true, false, 1, 1));
Button bSync = new Button(parent, SWT.NONE);
bSync.setText("Sync");
new Label(parent, SWT.NONE);
ListViewer listViewer = new ListViewer(parent, SWT.BORDER | SWT.V_SCROLL);
List list = listViewer.getList();
listViewer.setContentProvider(new ContentProvider());
listViewer.setLabelProvider(new ViewerLabelProvider());
new Label(parent, SWT.NONE);
bSync.addSelectionListener(new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
super.widgetSelected(e);
updateProjects();
}
});
}
示例8: RuntimeServiceSelectionComposite
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
/**
* Create the composite.
* @param parent
* @param style
*/
public RuntimeServiceSelectionComposite(Composite parent, int style)
{
super(parent, style);
setLayout(new GridLayout(1, false));
Label lblSelect = new Label(this, SWT.NONE);
lblSelect.setText("Select platform runtime service");
listViewer = new ListViewer(this, SWT.BORDER | SWT.V_SCROLL);
List list = listViewer.getList();
list.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
}
示例9: createContents
import org.eclipse.jface.viewers.ListViewer; //導入方法依賴的package包/類
@Override
protected Control createContents(Composite parent){
Composite mainArea = new Composite(parent, SWT.NONE);
mainArea.setLayoutData(SWTHelper.getFillGridData(1, true, 1, true));
TableWrapLayout layout = new TableWrapLayout();
layout.numColumns = 2;
layout.leftMargin = 0;
layout.rightMargin = 0;
layout.topMargin = 0;
layout.bottomMargin = 0;
mainArea.setLayout(layout);
TableWrapData twd;
Label label;
Text infoText = new Text(mainArea, SWT.MULTI | SWT.READ_ONLY | SWT.WRAP);
infoText.setLayoutData(SWTHelper.getFillTableWrapData(2, true, 1, false));
infoText.setText("Bitte wählen Sie die Labors aus, für welche Sie die Werte"
+ " in der Praxis selber ermitteln.");
label = new Label(mainArea, SWT.NONE);
label.setText("Praxislabors:");
ownLaborsList = new ListViewer(mainArea, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
List list = ownLaborsList.getList();
twd = SWTHelper.getFillTableWrapData(1, true, 1, false);
twd.heightHint = VISIBLE_NUMBER_OF_LABORS * list.getItemHeight();
list.setLayoutData(twd);
ownLaborsList.setContentProvider(new LaborsListContentProvider());
ownLaborsList.setLabelProvider(new LaborsListLabelProvider());
ownLaborsList.setInput(this);
Label lblNoCols = new Label(mainArea, SWT.NONE);
lblNoCols.setText("Spalten pro Seite:");
spinnerNoCol = new Spinner(mainArea, SWT.BORDER);
spinnerNoCol.setPageIncrement(1);
spinnerNoCol.setMaximum(10);
spinnerNoCol.setMinimum(1);
spinnerNoCol.setSelection(7);
loadFromConfig();
return mainArea;
}