本文整理匯總了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
);
}
});
}
示例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
);
}
});
}
示例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);
}
});
}
示例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);
}
});
}
示例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();
}
});
}
示例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();
}
});
}
示例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();
}
};
}
示例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;
}
示例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();
}
示例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);
}
});
}
示例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();
}
}
});
}
示例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();
}
}
});
}
示例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;
}
示例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);
}
示例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();
}
});
}