當前位置: 首頁>>代碼示例>>Java>>正文


Java List.select方法代碼示例

本文整理匯總了Java中org.eclipse.swt.widgets.List.select方法的典型用法代碼示例。如果您正苦於以下問題:Java List.select方法的具體用法?Java List.select怎麽用?Java List.select使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.eclipse.swt.widgets.List的用法示例。


在下文中一共展示了List.select方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: createList

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * List UI 생성
 * 
 * @param operations
 *            void
 */
private void createList() {

    Display display = this.getCurrentViewer().getControl().getShell().getDisplay();
    Shell shell = new Shell(display);
    org.eclipse.swt.graphics.Point currentPoint = this.getCurrentViewer()
        .getControl()
        .getDisplay()
        .getCursorLocation();
    shell.setLocation(currentPoint.x, currentPoint.y);

    dialog = new Shell(shell, SWT.TOOL | SWT.APPLICATION_MODAL);
    dialog.setSize(120, 50);
    dialog.setLocation(currentPoint.x, currentPoint.y);
    dialog.setLayout(new FillLayout());
    final List list = new List(dialog, SWT.SINGLE | SWT.V_SCROLL);

    list.add(UMLMessage.getMessage(UMLMessage.LABEL_NO_TYPE));
    list.add(UMLMessage.getMessage(UMLMessage.LABEL_CREATE_CLASS));
    list.add(UMLMessage.getMessage(UMLMessage.LABEL_SELECT_TYPE));

    list.select(0);
    list.addFocusListener(this);
    list.addKeyListener(this);
    list.addMouseListener(this);

    dialog.open();
    while (!dialog.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    shell.dispose();
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:40,代碼來源:LifeLineCreationToolWithAdditionalInformation.java

示例2: switchListElements

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/***************************************************************************
 * Switch the elements at the given indexes from the given list
 * 
 * @param widget
 * @param firstelement
 * @param secondElement
 **************************************************************************/
private void switchListElements(List list, int firstelement,
        int secondElement)
{
	// Get selected presentation
	String first = list.getItem(firstelement);
	String second = list.getItem(secondElement);
	list.setItem(firstelement, second);
	list.setItem(secondElement, first);
	list.select(secondElement);
}
 
開發者ID:Spacecraft-Code,項目名稱:SPELL,代碼行數:18,代碼來源:PresentationsPreferencePage.java

示例3: createDialogArea

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * Set up GUI elements.
 *
 * @param parent the parent
 * @return the control
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite dialogContainer = (Composite) super.createDialogArea(parent);
	Composite columnContainer = new Composite(dialogContainer, SWT.NONE);
	columnContainer.setLayout(new GridLayout(1, false));
	GridData parentData = new GridData();
	parentData.grabExcessHorizontalSpace = true;
	parentData.grabExcessVerticalSpace = true;
	parentData.horizontalAlignment = GridData.FILL;
	parentData.verticalAlignment = GridData.FILL;
	columnContainer.setLayoutData(parentData);

	createOffsetParameterField(columnContainer);
	createTxtFilePathField(columnContainer);

	exporterList = new List(columnContainer, SWT.BORDER);
	for (String label : labels) {
		exporterList.add(label);
	}
	exporterList.select(0);
	GridData textData = new GridData();
	textData.grabExcessHorizontalSpace = true;
	textData.grabExcessVerticalSpace = true;
	textData.horizontalAlignment = GridData.FILL;
	textData.verticalAlignment = GridData.FILL;
	exporterList.setLayoutData(textData);

	return dialogContainer;
}
 
開發者ID:joakimkistowski,項目名稱:LIMBO,代碼行數:36,代碼來源:SelectExtractorDialog.java

示例4: createDialogArea

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * Set up GUI elements.
 *
 * @param parent the parent
 * @return the control
 */
@Override
protected Control createDialogArea(Composite parent) {
	Composite dialogContainer = (Composite) super.createDialogArea(parent);
	Composite columnContainer = new Composite(dialogContainer, SWT.NONE);
	columnContainer.setLayout(new GridLayout(1, false));
	GridData parentData = new GridData();
	parentData.grabExcessHorizontalSpace = true;
	parentData.grabExcessVerticalSpace = true;
	parentData.horizontalAlignment = GridData.FILL;
	parentData.verticalAlignment = GridData.FILL;
	columnContainer.setLayoutData(parentData);

	exporterList = new List(columnContainer, SWT.BORDER);
	for (String label : labels) {
		exporterList.add(label);
	}
	exporterList.select(0);
	GridData textData = new GridData();
	textData.grabExcessHorizontalSpace = true;
	textData.grabExcessVerticalSpace = true;
	textData.horizontalAlignment = GridData.FILL;
	textData.verticalAlignment = GridData.FILL;
	exporterList.setLayoutData(textData);

	return dialogContainer;
}
 
開發者ID:joakimkistowski,項目名稱:LIMBO,代碼行數:33,代碼來源:SelectExporterDialog.java

示例5: handleExtendRelationship

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * handleExtendRelationship
 *  
 * @param command
 * @return boolean
 */
private boolean handleExtendRelationship(CreateConnectionCommand command) {
    if (!command.isExpensible()) {
        return true;
    }
    if (!command.getConnection().getRelationType().equals(RelationType.EXTEND)) {
        return true;
    }

    UseCase useCase = (UseCase) command.getTarget().getUmlModel();

    Display display = this.getCurrentViewer().getControl().getShell().getDisplay();
    Shell shell = new Shell(display);
    org.eclipse.swt.graphics.Point currentPoint = this.getCurrentViewer()
        .getControl()
        .getDisplay()
        .getCursorLocation();
    shell.setLocation(currentPoint.x, currentPoint.y);

    dialog = new Shell(shell, SWT.TOOL | SWT.APPLICATION_MODAL);
    dialog.setSize(180, 80);
    dialog.setLocation(currentPoint.x, currentPoint.y);
    dialog.setLayout(new FillLayout());
    final List list = new List(dialog, SWT.SINGLE | SWT.V_SCROLL);

    list.add("<New>");
    for (ExtensionPoint extensionPoint : useCase.getExtensionPoints()) {
        list.add(extensionPoint.getName());
    }
    list.select(0);
    list.addFocusListener(this);
    list.addKeyListener(this);
    list.addMouseListener(this);

    dialog.open();
    while (!dialog.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    shell.dispose();

    if (-1 == selectedIndex) {
        return false;
    } else if (0 == selectedIndex) {
        command.setExtensionPoint(null);
        return true;
    } else {
        command.setExtensionPoint(useCase.getExtensionPoints().get(selectedIndex - 1));
        return true;
    }
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:58,代碼來源:ConnectionCreationToolForUsecaseDiagramRelationship.java

示例6: createList

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * List UI 생성
 * 
 * @param operations
 *            void
 */
private void createList(java.util.List<Operation> operations) {

    Display display = this.getCurrentViewer().getControl().getShell().getDisplay();
    Shell shell = new Shell(display);
    org.eclipse.swt.graphics.Point currentPoint = this.getCurrentViewer()
        .getControl()
        .getDisplay()
        .getCursorLocation();
    shell.setLocation(currentPoint.x, currentPoint.y);

    dialog = new Shell(shell, SWT.TOOL | SWT.APPLICATION_MODAL);

    dialog.setLocation(currentPoint.x, currentPoint.y);
    dialog.setLayout(new FillLayout());
    final List list = new List(dialog, SWT.SINGLE | SWT.V_SCROLL | SWT.H_SCROLL);
    list.add("<New>");

    // operation을 list에 보여준다.
    if (operations != null) {
        for (Operation operation : operations) {
            list.add(SequenceUtil.getOperationVisibility(operation) + UICoreConstant.PROJECT_CONSTANTS__BLANK
                + ((NamedElement) operation.eContainer()).getName()
                + UICoreConstant.PROJECT_CONSTANTS__DOUBLE_COLON + operation.getName() + " ()");
        }
    }

    list.select(0);
    list.addFocusListener(this);
    list.addKeyListener(this);
    list.addMouseListener(this);
    int x, y;
    x = 300;
    y = list.getItems().length * 13;
    y = y < 100 ? 100 : y;
    y = y > 400 ? 400 : y;
    dialog.setSize(x, y);

    selectedIndex = -1;
    dialog.open();
    while (!dialog.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }
    shell.dispose();
}
 
開發者ID:SK-HOLDINGS-CC,項目名稱:NEXCORE-UML-Modeler,代碼行數:53,代碼來源:MessageCreationToolForSequenceDiagramRelationship.java


注:本文中的org.eclipse.swt.widgets.List.select方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。