Java 类org.eclipse.swt.events.MouseAdapter 实例源码

项目:Hydrograph    文件:OutputRecordCountWidget.java   
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
                    );
        }
    });
}
项目:Hydrograph    文件:OutputRecordCountWidget.java   
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
                    );
        }
       });
}
项目:Hydrograph    文件:ELTSchemaGridWidget.java   
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);
            }
        });
    }
项目:Hydrograph    文件:ELTSchemaGridWidget.java   
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);
            }
        });
    }
项目:Hydrograph    文件:ELTSchemaGridWidget.java   
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();
     }


 });


}
项目:Hydrograph    文件:ELTSchemaGridWidget.java   
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();
     }
 });


}
项目:termsuite-ui    文件:ProgressAnimationItem.java   
/**
 * 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();
        }
    };
}
项目:egradle    文件:OpenGradleResourceDialog.java   
@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;
}
项目:TuxGuitar-1.3.1-fork    文件:TGTableViewer.java   
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();
}
项目:ermasterr    文件:ERDiagramMultiPageEditor.java   
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);
        }
    });
}
项目:logbook    文件:ItemTable.java   
@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();
            }
        }
    });
}
项目:logbook    文件:DropReportTable.java   
@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();
            }
        }
    });
}
项目:ForgedUI-Eclipse    文件:BooleanPropertyDescriptor.java   
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;
  }
项目:statecharts    文件:AbstractEditorPropertySection.java   
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);
}
项目:Permo    文件:FileDiffTable.java   
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();
    }
  });
}
项目:org.csstudio.display.builder    文件:ColorBlob.java   
/** Initialize
 *  @param parent Parent widget
 */
public ColorBlob(final Composite parent, final RGB rgb)
{
    super(parent, SWT.BORDER);
    color = new Color(getDisplay(), rgb);
    addDisposeListener(this);
    addPaintListener(this);
    addMouseListener(new MouseAdapter()
    {
        @Override
        public void mouseDown(MouseEvent e)
        {
            if (selected != null)
                selected.widgetSelected(null);
        }
    });
}
项目:org.csstudio.display.builder    文件:SWTBaseRepresentation.java   
/** {@inheritDoc} */
@Override
final public Composite createComponents(final Composite parent) throws Exception
{
    control = createSWTControl(parent);
    control.addMouseListener(new MouseAdapter()
    {
        @Override
        public void mouseDown(final MouseEvent e)
        {
            toolkit.fireClick(model_widget, (e.stateMask & SWT.CONTROL) != 0);
        }
    });

    registerListeners();
    updateChanges();
    return getChildParent(parent);
}
项目:skin4eclipse    文件:ShowTabListButton.java   
public ShowTabListButton(Composite parent, int style, TabArea tabArea) {
    super(parent, style, true);
    this.tabArea = tabArea;
    tabArea.addLayoutListener(this);
    menu = new PartListMenu(tabArea, false, false);
    setToolTipText("Show tab list");
    addMouseListener(new MouseAdapter() {
        public void mouseUp(MouseEvent e) {
            if(menu != null){
                Point toDisplay = toDisplay(getLocation());
                toDisplay.y += getSize().y;
                menu.show(ShowTabListButton.this, toDisplay, true);
            }
        }
    });
}
项目:PDFReporter-Studio    文件:KeyTreeContributor.java   
/**
 * Contributes double-click support, expanding/collapsing nodes.
 *
 * @param treeViewer
 *            tree viewer
 */
private void contributeDoubleClick(final TreeViewer treeViewer) {
    treeViewer.getTree().addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent event) {
            IStructuredSelection selection = (IStructuredSelection) treeViewer
                    .getSelection();
            Object element = selection.getFirstElement();
            if (treeViewer.isExpandable(element)) {
                if (treeViewer.getExpandedState(element)) {
                    treeViewer.collapseToLevel(element, 1);
                } else {
                    treeViewer.expandToLevel(element, 1);
                }
            }
        }
    });
}
项目:APICloud-Studio    文件:GenericInfoPopupDialog.java   
public GenericInfoPopupDialog(Shell parentShell, String title, String message, final Runnable runnable)
{
    super(parentShell, PopupDialog.INFOPOPUPRESIZE_SHELLSTYLE | SWT.MODELESS, false, true, true, false, false,
            title, null);
    this.message = message;

    clickListener = new MouseAdapter()
    {

        @Override
        public void mouseDown(MouseEvent e)
        {
            if (runnable != null)
            {
                runnable.run();
            }
            close();
        }
    };
}
项目:erflute    文件:ERFluteMultiPageEditor.java   
private void addMouseListenerToTabFolder() {
    final CTabFolder tabFolder = (CTabFolder) getContainer();
    tabFolder.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDoubleClick(MouseEvent mouseevent) {
            final Category category = getCurrentPageCategory();
            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);
        }
    });
}
项目:mytourbook    文件:KeyTreeContributor.java   
/**
 * Contributes double-click support, expanding/collapsing nodes.
 * @param treeViewer tree viewer
 */
private void contributeDoubleClick(final TreeViewer treeViewer) {
    treeViewer.getTree().addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent event) {
            IStructuredSelection selection = 
                (IStructuredSelection) treeViewer.getSelection();
            Object element = selection.getFirstElement();
            if (treeViewer.isExpandable(element)) {
                if (treeViewer.getExpandedState(element)) {
                    treeViewer.collapseToLevel(element, 1);
                } else {
                    treeViewer.expandToLevel(element, 1);
                }
            }
        }
    });
}
项目:mytourbook    文件:KeyTreeContributor.java   
/**
 * Contributes double-click support, expanding/collapsing nodes.
 * @param treeViewer tree viewer
 */
private void contributeDoubleClick(final TreeViewer treeViewer) {
    treeViewer.getTree().addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent event) {
            IStructuredSelection selection = 
                (IStructuredSelection) treeViewer.getSelection();
            Object element = selection.getFirstElement();
            if (treeViewer.isExpandable(element)) {
                if (treeViewer.getExpandedState(element)) {
                    treeViewer.collapseToLevel(element, 1);
                } else {
                    treeViewer.expandToLevel(element, 1);
                }
            }
        }
    });
}
项目:mytourbook    文件:KeyTreeContributor-modified.java   
/**
  * Contributes double-click support, expanding/collapsing nodes.
  * @param treeViewer tree viewer
  */
 private void contributeDoubleClick(final TreeViewer treeViewer) {
     treeViewer.getTree().addMouseListener(new MouseAdapter() {
         @Override
public void mouseDoubleClick(final MouseEvent event) {
             final IStructuredSelection selection = 
                 (IStructuredSelection) treeViewer.getSelection();
             final Object element = selection.getFirstElement();
             if (treeViewer.isExpandable(element)) {
                 if (treeViewer.getExpandedState(element)) {
                     treeViewer.collapseToLevel(element, 1);
                 } else {
                     treeViewer.expandToLevel(element, 1);
                 }
             }
         }
     });
 }
项目:mytourbook    文件:KeyTreeContributor.java   
/**
 * Contributes double-click support, expanding/collapsing nodes.
 * @param treeViewer tree viewer
 */
private void contributeDoubleClick(final TreeViewer treeViewer) {
    treeViewer.getTree().addMouseListener(new MouseAdapter() {
        public void mouseDoubleClick(MouseEvent event) {
            IStructuredSelection selection = 
                (IStructuredSelection) treeViewer.getSelection();
            Object element = selection.getFirstElement();
            if (treeViewer.isExpandable(element)) {
                if (treeViewer.getExpandedState(element)) {
                    treeViewer.collapseToLevel(element, 1);
                } else {
                    treeViewer.expandToLevel(element, 1);
                }
            }
        }
    });
}
项目:OpenSPIFe    文件:TypableCombo.java   
public TypableCombo(Composite parent, int style) {
    super(parent, style);
    new FilteringAdapter(this);
    // MAE-4628
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDown(MouseEvent e) {
            setFocus();
        }
    });

    addListener(SWT.Selection, new Listener() {
        @Override
        public void handleEvent(Event arg0) {
            resetIndexes();
        }
    });
}
项目:OpenSPIFe    文件:LevelIndicator.java   
public LevelIndicator(Composite parent, int style, int minLevel, int maxLevel) {
    super(parent, style);
    max = maxLevel;
    min = minLevel;
    addPaintListener(this);
    addDisposeListener(this);
    red = new Color(parent.getDisplay(), 255, 100 ,0);
    green = new Color(parent.getDisplay(), 0, 255 ,100);
    size = new Point(LEVEL_WIDTH+2, LEVEL_HEIGHT);
    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseUp(MouseEvent e) {
            reset();
        }
    });
}
项目:OpenSPIFe    文件:DisappearText.java   
public DisappearText(Composite parent, String text, int style) {
    super(parent, style);
    setText(text);
    setRedraw(true);
    setTextLimit(1000);

    addMouseListener(new MouseAdapter() {
        @Override
        public void mouseUp(MouseEvent e) {
            if(!isBeenClicked()){
                setText("");
                setBeenClicked(true);
            }
        }
    });
}
项目:mondo-collab-framework    文件:CurrentUserView.java   
@Override
public void createPartControl(Composite parent) {
    Composite composite = new Composite(parent, SWT.None);
    FillLayout layout = new FillLayout();
    layout.type = SWT.VERTICAL;
    composite.setLayout(layout);
    {
        label = new Label(composite, SWT.None);
        setCurrentUser(username);

        logout = new Button(composite, SWT.None);
        logout.setText("Logout");
        logout.addMouseListener(new MouseAdapter() {

            @Override
            public void mouseUp(MouseEvent e) {
                super.mouseUp(e);
                logout();
            }
        });
        logout.setVisible(false);
    }

    callback = new SetCurrentUser();
    UINotifierManager.register(ModelExplorer.EVENT_USER_LOGGED_IN, RWT.getUISession(), callback);
}
项目:translationstudio8    文件:CustomFilterDialog.java   
/**
 * 初始化自定义过滤器列表
 * @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();
        }

    });
}
项目:translationstudio8    文件:HtmlBrowserEditor.java   
@Override
public void createPartControl(Composite parent) {
    GridLayoutFactory.fillDefaults().numColumns(1).applyTo(parent);
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));
    cmp = new Composite(parent, SWT.BORDER);
    GridLayoutFactory.fillDefaults().numColumns(1).applyTo(cmp);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(cmp);

    browser = new Browser(cmp, SWT.NONE);
    browser.setLayoutData(new GridData(GridData.FILL_BOTH));
    browser.setUrl(htmlUrl);

    browser.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDown(MouseEvent e) {
            getSite().getPart().setFocus();
            super.mouseDown(e);
        }
    });
}
项目:translationstudio8    文件:ColorPicker.java   
public ColorPicker(Composite parent, final Color originalColor) {
    super(parent, SWT.SHADOW_OUT);
    if (originalColor == null) throw new IllegalArgumentException("null");
    this.selectedColor = originalColor;
    setImage(getColorImage(originalColor));
    addMouseListener(
            new MouseAdapter() {
                @Override
                public void mouseDown(MouseEvent e) {
                    ColorDialog dialog = new ColorDialog(new Shell(Display.getDefault(), SWT.SHELL_TRIM));
                    dialog.setRGB(selectedColor.getRGB());
                    RGB selected = dialog.open();
                    if (selected != null) {
                        update(selected);
                    }
                }
            });
}
项目:gef-gwt    文件:ControlDecoration.java   
Hover(Shell parent) {
    final Display display = parent.getDisplay();
    hoverShell = new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP
            | SWT.NO_FOCUS | SWT.TOOL);
    hoverShell.setBackground(display
            .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    hoverShell.setForeground(display
            .getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    hoverShell.addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent pe) {
            pe.gc.drawText(text, hm, hm);
            if (!MAC) {
                pe.gc.drawPolygon(getPolygon(true));
            }
        }
    });
    hoverShell.addMouseListener(new MouseAdapter() {
        public void mouseDown(MouseEvent e) {
            hideHover();
        }
    });
}
项目:gef-gwt    文件:DecoratedField.java   
Hover(Shell parent) {
    final Display display = parent.getDisplay();
    hoverShell = new Shell(parent, SWT.NO_TRIM | SWT.ON_TOP
            | SWT.NO_FOCUS | SWT.TOOL);
    hoverShell.setBackground(display
            .getSystemColor(SWT.COLOR_INFO_BACKGROUND));
    hoverShell.setForeground(display
            .getSystemColor(SWT.COLOR_INFO_FOREGROUND));
    hoverShell.addPaintListener(new PaintListener() {
        public void paintControl(PaintEvent pe) {
            pe.gc.drawString(text, hm, hm);
            if (!MAC) {
                pe.gc.drawPolygon(getPolygon(true));
            }
        }
    });
    hoverShell.addMouseListener(new MouseAdapter() {
        public void mouseDown(MouseEvent e) {
            hideHover();
        }
    });
}
项目:gef-gwt    文件:TableTreeViewer.java   
protected void hookControl(Control control) {
    super.hookControl(control);
    tableTree.getTable().addMouseListener(new MouseAdapter() {
        public void mouseDown(MouseEvent e) {
            /*
             * If user clicked on the [+] or [-], do not activate
             * CellEditor.
             */
            // XXX: This code should not be here. SWT should either have
            // support to see
            // if the user clicked on the [+]/[-] or manage the table editor
            // activation
            org.eclipse.swt.widgets.TableItem[] items = tableTree
                    .getTable().getItems();
            for (int i = 0; i < items.length; i++) {
                Rectangle rect = items[i].getImageBounds(0);
                if (rect.contains(e.x, e.y)) {
                    return;
                }
            }

            tableEditorImpl.handleMouseDown(e);
        }
    });
}
项目:emf-forms-rap-showcase    文件:MainUi.java   
private static void makeLink(Label control, final String url) {
    control.setCursor(control.getDisplay().getSystemCursor(SWT.CURSOR_HAND));
    control.addMouseListener(new MouseAdapter() {
        /**
         *
         */
        private static final long serialVersionUID = 1L;

        @Override
        public void mouseDown(MouseEvent e) {
            final JavaScriptExecutor executor = RWT.getClient().getService(
                JavaScriptExecutor.class);
            if (executor != null) {
                executor.execute("window.location.href = '" + url + "'");
            }
        }
    });
}
项目:tmxeditor8    文件:CustomFilterDialog.java   
/**
 * 初始化自定义过滤器列表
 * @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();
        }

    });
}
项目:tmxeditor8    文件:HtmlBrowserEditor.java   
@Override
public void createPartControl(Composite parent) {
    GridLayoutFactory.fillDefaults().numColumns(1).applyTo(parent);
    parent.setLayoutData(new GridData(GridData.FILL_BOTH));
    cmp = new Composite(parent, SWT.BORDER);
    GridLayoutFactory.fillDefaults().numColumns(1).applyTo(cmp);
    GridDataFactory.fillDefaults().grab(true, true).applyTo(cmp);

    browser = new Browser(cmp, SWT.NONE);
    browser.setLayoutData(new GridData(GridData.FILL_BOTH));
    browser.setUrl(htmlUrl);

    browser.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDown(MouseEvent e) {
            getSite().getPart().setFocus();
            super.mouseDown(e);
        }
    });
}
项目:tmxeditor8    文件:ColorPicker.java   
public ColorPicker(Composite parent, final Color originalColor) {
    super(parent, SWT.SHADOW_OUT);
    if (originalColor == null) throw new IllegalArgumentException("null");
    this.selectedColor = originalColor;
    setImage(getColorImage(originalColor));
    addMouseListener(
            new MouseAdapter() {
                @Override
                public void mouseDown(MouseEvent e) {
                    ColorDialog dialog = new ColorDialog(new Shell(Display.getDefault(), SWT.SHELL_TRIM));
                    dialog.setRGB(selectedColor.getRGB());
                    RGB selected = dialog.open();
                    if (selected != null) {
                        update(selected);
                    }
                }
            });
}
项目:DynamicSpotter    文件:ConfigParamSetEditingDialog.java   
private void createTableListener() {
    final Table tblConfiguredElements = checkConfElemsTblViewer.getTable();
    tblConfiguredElements.addMouseListener(new MouseAdapter() {
        @Override
        public void mouseDown(MouseEvent e) {
            if (tblConfiguredElements.getSelectionCount() > 0) {
                TableItem item = tblConfiguredElements.getSelection()[0];
                if (item.getBounds(0).contains(new Point(e.x, e.y))) {
                    Object data = item.getData();
                    boolean oldState = checkConfElemsTblViewer.getChecked(data);
                    checkConfElemsTblViewer.setChecked(data, !oldState);
                }
            }
        }
    });
}