本文整理匯總了Java中org.eclipse.swt.widgets.List類的典型用法代碼示例。如果您正苦於以下問題:Java List類的具體用法?Java List怎麽用?Java List使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
List類屬於org.eclipse.swt.widgets包,在下文中一共展示了List類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: createCustomArea
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
/**
* Creates and returns the contents of an area of the dialog which appears
* below the message and above the button bar.
*
* This implementation creates two labels and two textfields.
*
* @param parent parent composite to contain the custom area
* @return the custom area control, or <code>null</code>
*/
protected Control createCustomArea(Composite parent) {
Composite composite = new Composite(parent, SWT.NULL);
composite.setLayoutData(new GridData(GridData.FILL_BOTH));
composite.setLayout(new GridLayout());
skVarList = new List(composite, SWT.MULTI | SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
skVarList.setLayoutData(new GridData(GridData.FILL_BOTH));
skVarList.setItems(items);
skVarList.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent event) {
selections = skVarList.getSelectionIndices();
}});
return composite;
}
示例2: createContents
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
@Override
protected Control createContents(Composite parent) {
Label trackerListLabel = new Label(parent, SWT.NONE);
trackerListLabel.setText("Eye Tracker Interface");
//Get currently selected eye tracker type as index into list.
TrackerType[] trackerKeys = EyeTrackerFactory.getAvailableEyeTrackers()
.keySet().toArray(new TrackerType[0]);
int trackerSelectionIndex = Arrays.asList(trackerKeys).indexOf(
TrackerType.valueOf(getPreferenceStore()
.getString(EYE_TRACKER_TYPE)));
//Create tracker list.
trackerList = new List(parent, SWT.BORDER);
String[] items = EyeTrackerFactory.getAvailableEyeTrackers().values()
.toArray(new String[0]);
trackerList.setItems(items);
trackerList.setSelection(trackerSelectionIndex);
return parent;
}
示例3: getCloneConstructor
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
@Override
public CloneConstructor
getCloneConstructor()
{
return(
new CloneConstructor()
{
public Class<? extends UISWTViewCoreEventListenerEx>
getCloneClass()
{
return( ConfigView.class );
}
public java.util.List<Object>
getParameters()
{
return( null );
}
});
}
示例4: createDialogArea
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
@Override
protected Control createDialogArea(Composite parent) {
Composite area = (Composite) super.createDialogArea(parent);
Composite container = new Composite(area, SWT.NONE);
container.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
GridLayout layout = new GridLayout(2, false);
container.setLayout(layout);
Label lbtOcciServerUrl = new Label(container, SWT.NONE);
lbtOcciServerUrl.setText(Messages.OcciActionDialog_Label);
final List listOcciActions = new List (container, SWT.BORDER | SWT.SINGLE | SWT.V_SCROLL);
listOcciActions.addSelectionListener(
new SelectionAdapter() {
@Override
public void widgetSelected(SelectionEvent e) {
selectedAction = listOcciActions.getSelection()[0];
}
}
);
listOcciActions.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
for(Action action : actions) {
listOcciActions.add(action.getScheme() + action.getTerm());
}
return area;
}
示例5: openEditorDialog
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
/**
* Open the config editor dialog for editing an existing configuration.
* This is called, when edit button is pressed.
*/
private void openEditorDialog() {
List list = getListControl(parent);
int index = list.getSelectionIndex();
if (index < 0) {
// no item selected from the list, do nothing
return;
}
String name = list.getItem(index);
if (name == null || name.length() == 0) {
// no name for the item, can't load config
return;
}
registry.setActiveViewer(name.substring(0, name.indexOf('(')-1));
ViewerConfigDialog dialog = new ViewerConfigDialog(editButton.getShell(),
(ViewerAttributeRegistry) registry.clone());
int code = dialog.open();
if (code == Window.OK) {
registry.mergeWith(dialog.getRegistry());
list.setItem(index, registry.getActiveViewer() + " (" + registry.getCommand() + ")");
}
}
示例6: init
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
public void init(){
Composite composite = new Composite(this,SWT.NONE);
composite.setLayout(new GridLayout());
composite.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
this.proposalParameters = new ArrayList<int[]>();
this.proposalList = new List(composite,SWT.BORDER | SWT.H_SCROLL | SWT.V_SCROLL);
this.proposalList.setLayoutData(new GridData(SWT.FILL,SWT.FILL,true,true));
this.proposalList.addSelectionListener(new SelectionAdapter() {
public void widgetSelected(SelectionEvent e) {
if(getDialog().getEditor() != null){
showChord(getProposalList().getSelectionIndex());
}
}
});
}
示例7: notifyProposals
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
public void notifyProposals(final long processId, final boolean sharp, final boolean redecorate, final boolean setChordName, final java.util.List<int[]> proposalParameters, final java.util.List<String> proposalNames) {
final int params[] = (!proposalParameters.isEmpty() ? (int[])proposalParameters.get(0) : null);
final String chordName = (params != null ? getChordName(params, sharp) : "");
TGSynchronizer.getInstance(this.dialog.getContext().getContext()).executeLater(new Runnable() {
public void run() {
if(!getDialog().isDisposed() && isValidProcess(processId)){
for(int[] currentProposalParameters : proposalParameters) {
addProposalParameters(currentProposalParameters);
}
for(String currentProposalName : proposalNames) {
addProposalName(currentProposalName);
}
if( redecorate && params != null ) {
redecorate(params);
}
if( setChordName ) {
getDialog().getEditor().setChordName( chordName != null ? chordName : "" );
}
}
}
});
}
示例8: shellsort
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
/**
* Shellsort, using a sequence suggested by Gonnet.
* -- a little adopted
* @param a List of Proposals, unsorted
* @param sortIndex 1 to sort by don'tHaveGrade, 2 to sort by unusualGrade
* @return sorted list by selected criteria
*/
public void shellsort( java.util.List<Proposal> a, int sortIndex ){
int length = a.size();
for( int gap = length / 2; gap > 0;
gap = gap == 2 ? 1 : (int) ( gap / 2.2 ) )
for( int i = gap; i < length; i++ ){
Proposal tmp = (Proposal)a.get(i);
int j = i;
for( ; j >= gap &&
( sortIndex == 1 ?
tmp.dontHaveGrade > ((Proposal)a.get(j - gap)).dontHaveGrade :
tmp.unusualGrade > ((Proposal)a.get(j - gap)).unusualGrade )
;
j -= gap )
a.set(j, a.get(j - gap));
a.set( j , tmp);
}
}
示例9: widgetSelected
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
/**
* Called when the user selects an item in the List.
*/
public void widgetSelected(SelectionEvent e)
{
List list = ((List) e.widget);
Spec spec = ToolboxHandle.getCurrentSpec();
if (spec != null)
{
spec.setModuleToShow(list.getSelection()[0]);
String moduleName = list.getSelection()[0];
spec.setModuleToShow(list.getSelection()[0]);
int idx = selectString(moduleNames, moduleName);
if (idx != -1)
{
setUseMarkers(showUses[idx], moduleName, spec);
}
}
}
示例10: showRefs
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
private void showRefs(Scanner input, ArrayList<String> refStrings) {
while(input.hasNext()){
String line = input.nextLine();
if (!line.equals("") && line.length() > 0)
refStrings.add(line);
}
if (refStrings.size() == 0){
MessageBox dialog =
new MessageBox(parent.getShell(), SWT.ERROR | SWT.OK);
dialog.setText("Error");
dialog.setMessage("No refactoring information was found!");
dialog.open();
} else{
list = new List(parent, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
list.setBounds (20, 100, 250, 250);
list.setVisible(true);
for (int i = 0; i < refStrings.size(); i++) {
list.add(refStrings.get(i));
}
}
}
示例11: loadListOfServers
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
private void loadListOfServers(List list) {
ServerStore serverStore = new ServerStore(
uk.ac.york.mondo.integration.api.dt.Activator.getDefault().getPreferenceStore());
java.util.List<Server> servers = serverStore.readAllServers();
list.removeAll();
list.add(CUSTOM_URL_TEXT);
list.setSelection(0); // by default select option "Custom URL"
for (Server server : servers) {
list.add(server.getBaseURL());
}
userName.setEnabled(false);
userName.setText("");
frontRepoURL.setText("");
}
示例12: handleAddInList
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
private void handleAddInList(List inlist) {
int index = Math.max(0, inlist.getSelectionIndex());
OperandDialog dialog = new OperandDialog(getShell());
ArrayList<AOperand> ops = new ArrayList<AOperand>(operands);
if (index < ops.size())
ops.add(index, new ParameterPOperand(value));
else
ops.add(new ParameterPOperand(value));
dialog.setValues(value, ops, index);
if (dialog.open() == Dialog.OK) {
AOperand op = dialog.getOperand();
if (index < ops.size())
operands.add(index + 1, op);
else
ops.add(op);
showInList(inlist);
}
}
示例13: handleAddInList
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
private void handleAddInList(List inlist) {
int index = Math.max(0, inlist.getSelectionIndex());
OperandDialog dialog = new OperandDialog(getShell());
ArrayList<AOperand> ops = new ArrayList<AOperand>(operands);
if (index < ops.size())
ops.add(index, Factory.getDefaultOperand(value));
else
ops.add(Factory.getDefaultOperand(value));
dialog.setValues(value, ops, index);
if (dialog.open() == Dialog.OK) {
AOperand op = dialog.getOperand();
if (index < ops.size())
operands.add(index + 1, op);
else
ops.add(op);
showInList(inlist);
}
}
示例14: refreshZipEntriesList
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
private void refreshZipEntriesList() {
zipFileContent.removeAll();
if(!zipEntries.isEmpty()){
java.util.List<String> fileLocations = new ArrayList<String>();
for(ZipEntry ze : zipEntries){
fileLocations.add(ze.getLocation());
}
Collections.sort(fileLocations);
for(String loc : fileLocations){
zipFileContent.add(loc);
}
zipFileContent.setFont(standardListFont);
}
else {
zipFileContent.add(Messages.IssueAttachmentDetailsPage_NoAttachments);
zipFileContent.setFont(ResourceManager.getItalicFont(standardListFont));
}
}
示例15: removeZipEntries
import org.eclipse.swt.widgets.List; //導入依賴的package包/類
private void removeZipEntries(java.util.List<String> entries) {
if(!zipEntries.isEmpty()){
for (Iterator<ZipEntry> it = zipEntries.iterator(); it.hasNext(); ){
ZipEntry ze = it.next();
if(entries.contains(ze.getLocation())){
switch (ze.getType()) {
case HW_SW_INFO:
btnSoftwareAndHardware.setSelection(false);
break;
case LOG:
btnLogFile.setSelection(false);
break;
case PREFS:
btnJaspersoftStudioPreferences.setSelection(false);
break;
default:
break;
}
it.remove();
}
}
}
}