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


Java MouseAdapter類代碼示例

本文整理匯總了Java中org.eclipse.swt.events.MouseAdapter的典型用法代碼示例。如果您正苦於以下問題:Java MouseAdapter類的具體用法?Java MouseAdapter怎麽用?Java MouseAdapter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: addSelectionListenerToExpressionRadioButton

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addSelectionListenerToExpressionRadioButton(Button expressionRadioButton) 
{
	expressionRadioButton.addMouseListener(new MouseAdapter() {

		@Override
		public void mouseUp(MouseEvent e) {
			outputRecordCoundText.setEnabled(true);
			editButton.setEnabled(true);
			transformMapping.setExpression(true);
			propertyDialogButtonBar.enableApplyButton(true);
			if(!transformMapping.getExpressionEditorData().isValid())
			{
				expressionValidateDecorator.show();
			}
			OutputRecordCountUtility.INSTANCE.removeOperationFieldFromOutputList(transformMapping);
			OutputRecordCountUtility.INSTANCE.addExpressionOutputFieldToOuterListOfMappingWindow(transformMapping);
			setSchemaUpdated(false);
			outputList.clear();
			SchemaSyncUtility.INSTANCE.unionFilter(transformMapping.getOutputFieldList(), 
					outputList);
			OutputRecordCountUtility.INSTANCE.propagateOuputFieldsToSchemaTabFromTransformWidget(
					transformMapping,getSchemaForInternalPropagation(),getComponent(),outputList
					);
 		}
	});
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:27,代碼來源:OutputRecordCountWidget.java

示例2: addSelectionListenerToOperationRadioButton

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addSelectionListenerToOperationRadioButton(Button operationRadioButton) 
{
	operationRadioButton.addMouseListener(new MouseAdapter() 
	{
		@Override
		public void mouseUp(MouseEvent e) {
			outputRecordCoundText.setEnabled(false);
			editButton.setEnabled(false);
			transformMapping.setExpression(false);
			propertyDialogButtonBar.enableApplyButton(true);
			expressionValidateDecorator.hide();
			OutputRecordCountUtility.INSTANCE.removeExpressionFieldFromOutputList(transformMapping);
			OutputRecordCountUtility.INSTANCE.addOperationOutputFieldToOuterListOfMappingWindow(transformMapping);
			setSchemaUpdated(false);
			outputList.clear();
			SchemaSyncUtility.INSTANCE.unionFilter(transformMapping.getOutputFieldList(), 
					outputList);
			OutputRecordCountUtility.INSTANCE.propagateOuputFieldsToSchemaTabFromTransformWidget(
					transformMapping,getSchemaForInternalPropagation(),getComponent(),outputList
					);
		}
       });
}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:24,代碼來源:OutputRecordCountWidget.java

示例3: addImportSchemaButton

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addImportSchemaButton(ELTSchemaSubgroupComposite buttonSubGroup) {

		importSchemaButton = new ELTDefaultButton("");
		SchemaButtonsSyncUtility.INSTANCE.buttonSize(importSchemaButton, macButtonWidth, macButtonHeight,
				windowButtonWidth, windowButtonHeight);
		buttonSubGroup.attachWidget(importSchemaButton);
		importSchemaButton.setImage(ImagePathConstant.IMPORT_SCHEMA_BUTTON);
		importSchemaButton.setToolTipText(Messages.IMPORT_SCHEMA_KEY_SHORTCUT_TOOLTIP);
		Button importButton = (Button) importSchemaButton.getSWTWidgetControl();
		importButton.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseDown(MouseEvent e) {
				importSchema(importButton);
			}
		});
	}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:18,代碼來源:ELTSchemaGridWidget.java

示例4: addExportSchemaButton

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addExportSchemaButton(ELTSchemaSubgroupComposite buttonSubGroup) {

		exportSchemaButton = new ELTDefaultButton("");
		SchemaButtonsSyncUtility.INSTANCE.buttonSize(exportSchemaButton, macButtonWidth, macButtonHeight,
				windowButtonWidth, windowButtonHeight);
		buttonSubGroup.attachWidget(exportSchemaButton);
		exportSchemaButton.setImage(ImagePathConstant.EXPORT_SCHEMA_BUTTON);
		exportSchemaButton.setToolTipText(Messages.EXPORT_SCHEMA_KEY_SHORTCUT_TOOLTIP);
		Button exportButton = (Button) exportSchemaButton.getSWTWidgetControl();
		exportButton.addMouseListener(new MouseAdapter() {

			@Override
			public void mouseDown(MouseEvent e) {
				exportSchemaIntoFile(exportButton);
			}
		});
	}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:18,代碼來源:ELTSchemaGridWidget.java

示例5: addUpButton

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addUpButton(ELTSchemaSubgroupComposite buttonSubGroup) {
 upButton = new ELTDefaultButton("");
 SchemaButtonsSyncUtility.INSTANCE.buttonSize(upButton, macButtonWidth, macButtonHeight, windowButtonWidth, windowButtonHeight);
 buttonSubGroup.attachWidget(upButton);
 upButton.setImage(ImagePathConstant.MOVEUP_BUTTON);
 upButton.setToolTipText(Messages.MOVE_UP_KEY_SHORTCUT_TOOLTIP);
 ((Button)upButton.getSWTWidgetControl()).addMouseListener(new MouseAdapter() {

	 @Override
	 public void mouseDown(MouseEvent e) {
		 moveRowUp();
	 }


 });


}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:19,代碼來源:ELTSchemaGridWidget.java

示例6: addDownButton

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addDownButton(ELTSchemaSubgroupComposite buttonSubGroup) {
 downButton = new ELTDefaultButton("");
 SchemaButtonsSyncUtility.INSTANCE.buttonSize(downButton, macButtonWidth, macButtonHeight, windowButtonWidth, windowButtonHeight);
 buttonSubGroup.attachWidget(downButton);

 downButton.setImage(ImagePathConstant.MOVEDOWN_BUTTON);
 downButton.setToolTipText(Messages.MOVE_DOWN_KEY_SHORTCUT_TOOLTIP);

 ((Button)downButton.getSWTWidgetControl()).addMouseListener(new MouseAdapter() {

	 @Override
	 public void mouseDown(MouseEvent e) {
		 moveRowDown();
	 }
 });


}
 
開發者ID:capitalone,項目名稱:Hydrograph,代碼行數:19,代碼來源:ELTSchemaGridWidget.java

示例7: ProgressAnimationItem

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
/**
 * Create an instance of the receiver in the supplied region.
 *
 * @param region
 *            The ProgressRegion that contains the receiver.
 * @param flags
 *            flags to use for creation of the progress bar
 */
ProgressAnimationItem(ProgressRegion region, int flags,
        AnimationManager animationManager, FinishedJobs finishedJobs) {
	super(animationManager);
	this.flags = flags;
	this.finishedJobs = finishedJobs;
	finishedJobs.addListener(this);

	progressRegion = region;
	mouseListener = new MouseAdapter() {
		@Override
		public void mouseDoubleClick(MouseEvent e) {
			doAction();
		}
	};
}
 
開發者ID:termsuite,項目名稱:termsuite-ui,代碼行數:24,代碼來源:ProgressAnimationItem.java

示例8: createButtonsForButtonBar

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
@Override
protected void createButtonsForButtonBar(final Composite parent) {
	GridLayout parentLayout = (GridLayout) parent.getLayout();
	parentLayout.makeColumnsEqualWidth = false;

	openWithButton = createDropdownButton(parent, OPEN_WITH_ID, "Open with", new MouseAdapter() {
		@Override
		public void mouseDown(MouseEvent e) {
			showOpenWithMenu();
		}
	});
	setButtonLayoutData(openWithButton);

	new Label(parent, SWT.NONE).setLayoutData(new GridData(5, 0));
	parentLayout.numColumns++;

	Button okButton = createButton(parent, IDialogConstants.OK_ID, "Open", true);
	Button cancelButton = createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false);

	GridData cancelLayoutData = (GridData) cancelButton.getLayoutData();
	GridData okLayoutData = (GridData) okButton.getLayoutData();
	int buttonWidth = Math.max(cancelLayoutData.widthHint, okLayoutData.widthHint);
	cancelLayoutData.widthHint = buttonWidth;
	okLayoutData.widthHint = buttonWidth;
}
 
開發者ID:de-jcup,項目名稱:egradle,代碼行數:26,代碼來源:OpenGradleResourceDialog.java

示例9: addTable

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addTable(){
	MouseListener listener = mouseFocusListener();
	this.table = new TGTable(this.context, getComposite());
	this.table.getColumnNumber().getControl().addMouseListener(listener);
	this.table.getColumnSoloMute().getControl().addMouseListener(listener);
	this.table.getColumnName().getControl().addMouseListener(listener);
	this.table.getColumnInstrument().getControl().addMouseListener(listener);
	this.table.getColumnCanvas().getControl().addMouseListener(listener);
	this.table.getColumnCanvas().getControl().addMouseListener(new MouseAdapter() {
		public void mouseDoubleClick(MouseEvent e) {
			new TGActionProcessor(TuxGuitar.getInstance().getContext(), TGOpenSongInfoDialogAction.NAME).process();
		}
	});
	this.fireUpdate(true);
	this.loadProperties();
}
 
開發者ID:theokyr,項目名稱:TuxGuitar-1.3.1-fork,代碼行數:17,代碼來源:TGTableViewer.java

示例10: addMouseListenerToTabFolder

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void addMouseListenerToTabFolder() {
    final CTabFolder tabFolder = (CTabFolder) getContainer();

    tabFolder.addMouseListener(new MouseAdapter() {

        @Override
        public void mouseDoubleClick(final MouseEvent mouseevent) {

            final Category category = getPageCategory(getActivePage());

            if (category != null) {
                final CategoryNameChangeDialog dialog = new CategoryNameChangeDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), category);

                if (dialog.open() == IDialogConstants.OK_ID) {
                    final ChangeCategoryNameCommand command = new ChangeCategoryNameCommand(diagram, category, dialog.getCategoryName());
                    execute(command);
                }
            }

            super.mouseDoubleClick(mouseevent);
        }
    });
}
 
開發者ID:roundrop,項目名稱:ermasterr,代碼行數:24,代碼來源:ERDiagramMultiPageEditor.java

示例11: createContents

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
@Override
protected void createContents() {
    TableWrapper<ItemBean> table = this.addTable(this.shell)
            .setContentSupplier(CreateReportLogic::getItemTablecontent)
            .reload()
            .update();

    table.getTable().addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDoubleClick(MouseEvent e) {
            ItemBean[] selection = table.getSelection(ItemBean[]::new);
            for (ItemBean item : selection) {
                ShipFilterDto filter = new ShipFilterDto();
                filter.itemname = item.getName();
                new ShipTable(ItemTable.this.getParent(), filter).open();
            }
        }
    });
}
 
開發者ID:sanaehirotaka,項目名稱:logbook,代碼行數:20,代碼來源:ItemTable.java

示例12: createContents

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
@Override
protected void createContents() {
    TableWrapper<DropReportBean> table = this.addTable(this.shell)
            .setContentSupplier(CreateReportLogic::getBattleResultContent)
            .reload()
            .update();

    table.getTable().addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDoubleClick(MouseEvent e) {
            DropReportBean[] selection = table.getSelection(DropReportBean[]::new);
            for (DropReportBean item : selection) {
                new BattleDialog(DropReportTable.this.shell, item.getResult()).open();
            }
        }
    });
}
 
開發者ID:sanaehirotaka,項目名稱:logbook,代碼行數:18,代碼來源:DropReportTable.java

示例13: createPropertyEditor

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
public CellEditor createPropertyEditor(Composite parent) {
  	if (!this.editable){
  		return null;
  	}
      final ComboBoxCellEditor cellEditor = new ComboBoxCellEditor(parent,
      		new String[]{DEFAULT, Boolean.TRUE.toString(),Boolean.FALSE.toString()},
      		SWT.READ_ONLY);
      Control control = cellEditor.getControl();
      control.addMouseListener(new MouseAdapter() {
      	private final Integer ONE = new Integer(1);
      	private final Integer TWO = new Integer(2);
      	@Override
      	public void mouseDoubleClick(MouseEvent e) {
      		if (ONE.equals(cellEditor.getValue())){//true
      			cellEditor.setValue(2);//false
      		} else if (TWO.equals(cellEditor.getValue())){//false
      			cellEditor.setValue(1);//true
      		}
      		super.mouseDoubleClick(e);
      	}
});
      if (getValidator() != null) {
          cellEditor.setValidator(getValidator());
      }
      return cellEditor;
  }
 
開發者ID:ShoukriKattan,項目名稱:ForgedUI-Eclipse,代碼行數:27,代碼來源:BooleanPropertyDescriptor.java

示例14: createHelpWidget

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
protected void createHelpWidget(final Composite parent, final Control control, String helpId) {
	final ImageHyperlink helpWidget = toolkit.createImageHyperlink(parent, SWT.CENTER);
	Image defaultImage = PlatformUI.getWorkbench().getSharedImages().getImage(ISharedImages.IMG_LCL_LINKTO_HELP);
	helpWidget.setImage(defaultImage);
	GridDataFactory.fillDefaults().align(SWT.FILL, SWT.TOP).applyTo(helpWidget);
	helpWidget.setToolTipText(JFaceResources.getString(IDialogLabelKeys.HELP_LABEL_KEY));
	helpWidget.addMouseListener(new MouseAdapter() {
		public void mouseDown(MouseEvent e) {
			control.setFocus();
			PlatformUI.getWorkbench().getHelpSystem().displayDynamicHelp();
		}
	});
	GridDataFactory.fillDefaults().applyTo(helpWidget);
	helpWidget.setEnabled(true);
	setHelpContext(control, helpId);
}
 
開發者ID:Yakindu,項目名稱:statecharts,代碼行數:17,代碼來源:AbstractEditorPropertySection.java

示例15: registerListener

import org.eclipse.swt.events.MouseAdapter; //導入依賴的package包/類
private void registerListener() {
  getTable().addMouseListener(new MouseAdapter() {
    @Override
    public void mouseDoubleClick(final MouseEvent event) {
      if (getSelection() instanceof IStructuredSelection) {
        final IStructuredSelection selection = (IStructuredSelection) getSelection();
        if (selection.getFirstElement() instanceof DiffViewModel) {
          final DiffViewModel selectedDiff = (DiffViewModel) selection.getFirstElement();
          final GitFileDiffEditorInput editorInput = new GitFileDiffEditorInput(selectedDiff.getDiff());
          if ((event.stateMask & SWT.CTRL) != 0) {
            CompareUtil.openNewCompareEditor(editorInput);
          }
          else {
            CompareUtil.openExistingCompareEditor(editorInput);
          }

        }
      }
      getSelection();
    }
  });
}
 
開發者ID:sealuzh,項目名稱:Permo,代碼行數:23,代碼來源:FileDiffTable.java


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