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


Java List.addMouseListener方法代碼示例

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


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

示例1: initCustomFilterList

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * 初始化自定義過濾器列表
 * @param comp
 *            父容器
 */
private void initCustomFilterList(Composite comp) {
	customFilterList = new List(comp, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
	GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1);
	gridData.widthHint = 110;
	gridData.heightHint = 250;
	customFilterList.setLayoutData(gridData);
	setListData(customFilterList, customFilters);
	customFilterList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			edit();
		}

	});
}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:21,代碼來源:CustomFilterDialog.java

示例2: addDoubleClickListner

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private void addDoubleClickListner(final List methodList) {
	methodList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			if(methodList.getSelectionIndex()!=-1 && !StringUtils.startsWith(methodList.getItem(methodList.getSelectionIndex()),Messages.CANNOT_SEARCH_INPUT_STRING)){
			MethodDetails methodDetails = (MethodDetails) methodList.getData(String.valueOf(methodList
					.getSelectionIndex()));
				if(methodDetails !=null && StringUtils.isNotBlank(methodDetails.getPlaceHolder())){
					expressionEditorTextBox.insert(methodDetails.getPlaceHolder());
				}
	}
		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:15,代碼來源:FunctionsComposite.java

示例3: 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

示例4: initCustomFilterList

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
/**
 * 初始化已保存的條件列表
 * @param comp 父容器
 */
private void initCustomFilterList(Composite comp) {
	customFilterList = new List(comp, SWT.MULTI | SWT.V_SCROLL | SWT.H_SCROLL | SWT.BORDER);
	customFilterList.setLayoutData(new GridData(GridData.FILL_BOTH));
	setListData(customFilterList, customFilters);
	customFilterList.addMouseListener(new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			// 調編輯的方法
			edit();
		}

	});
}
 
開發者ID:heartsome,項目名稱:translationstudio8,代碼行數:18,代碼來源:CustomMatchConditionDialog.java

示例5: initFloatShell

import org.eclipse.swt.widgets.List; //導入方法依賴的package包/類
private void initFloatShell() {
      Point p = txtCurrentSelection.getParent().toDisplay(txtCurrentSelection.getLocation());
      Point size = txtCurrentSelection.getSize();
      Rectangle shellRect = new Rectangle(p.x, p.y + size.y, size.x, 0);
      shell = new Shell(MultiSelectionCombo.this.getShell(), SWT.NO_TRIM);
      
      GridLayout gl = new GridLayout();
      gl.marginBottom = 2;
      gl.marginTop = 2;
      gl.marginRight = 2;
      gl.marginLeft = 2;
      gl.marginWidth = 0;
      gl.marginHeight = 0;
      shell.setLayout(gl);

      list = new List(shell, SWT.BORDER | SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL);
      list.setToolTipText("Click and hold or use Ctrl to select multiple items");
      for (String value: textItems) {
    	  if(value!=null){
    		  list.add(value);
    	  }	 
         
      }

      if(currentSelection.length > 0){
    	  if(currentSelection[0]!=0){
    		  list.setSelection(currentSelection);
    	  }
      }
      

      GridData gd = new GridData(GridData.FILL_BOTH);
      list.setLayoutData(gd);

      shell.setSize(shellRect.width, 200);
      shell.setLocation(shellRect.x, shellRect.y);

      list.addMouseListener(new MouseAdapter() {

         @Override
         public void mouseUp(MouseEvent event) {
            super.mouseUp(event);
            if(list.getSelectionIndices().length > 0){
            	currentSelection = list.getSelectionIndices(); 
            } else {
            	currentSelection = new int[] { 0 };
            }
                       
            if ((event.stateMask & SWT.CTRL) == 0) {
//               displayText();
               parentComp.start = 0;
               parentComp.findText();               
               shell.dispose();
               
            }
         }
      });

      shell.addShellListener(new ShellAdapter() {

         public void shellDeactivated(ShellEvent arg0) {
            if (shell != null && !shell.isDisposed()) {
               if(list.getSelectionIndices().length > 0){
            	   currentSelection = list.getSelectionIndices(); 
               } else {
            	   currentSelection = new int[] { 0 };
               }
//               displayText();
               parentComp.start = 0;
               parentComp.findText();
               shell.dispose();
            }
         }
      });      
      shell.open();
      
   }
 
開發者ID:Transkribus,項目名稱:TranskribusSwtGui,代碼行數:78,代碼來源:MultiSelectionCombo.java

示例6: 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

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