Package org.eclipse.swt.events

Examples of org.eclipse.swt.events.MouseAdapter


        gridData.heightHint = 148;
        gridData.minimumHeight = 148;
        gridData.widthHint = 350;
        gridData.minimumWidth = 350;
        interceptorsTable.setLayoutData( gridData );
        interceptorsTable.addMouseListener( new MouseAdapter()
        {
            public void mouseDoubleClick( MouseEvent e )
            {
                if ( interceptorsTable.getSelectionIndex() != -1 )
                {
View Full Code Here


        config = new Label(control, SWT.SINGLE);
        config.setImage(JFaceResources.getImage(PopupDialog.POPUP_IMG_MENU));
        config.setLayoutData("cell 1 0,aligny top,height 16!, width 16!");
       
        createContextMenu( config );
        config.addMouseListener(new MouseAdapter() {
            public void mouseDown(org.eclipse.swt.events.MouseEvent e) {
                Menu menu = config.getMenu();
                if( menu != null ){
                    menu.setVisible(true);
                }
View Full Code Here

    GridData data = new GridData();
    data.horizontalAlignment = GridData.END;
    toolBar.setLayoutData(data);

    toolBar.addMouseListener(new MouseAdapter() {
      public void mouseDown(MouseEvent e) {
        showViewMenu();
      }
    });
View Full Code Here

    tableColumnKeySequence.setText(Util.translateString(RESOURCE_BUNDLE,
        "tableColumnKeySequence")); //$NON-NLS-1$
    tableColumnKeySequence.pack();
    tableColumnKeySequence.setWidth(300);

    tableBindingsForCommand.addMouseListener(new MouseAdapter() {

      public void mouseDoubleClick(MouseEvent mouseEvent) {
        update();
      }
    });

    tableBindingsForCommand.addSelectionListener(new SelectionAdapter() {

      public void widgetSelected(SelectionEvent selectionEvent) {
        selectedTableBindingsForCommand();
      }
    });

    final Group groupKeySequence = new Group(composite, SWT.SHADOW_NONE);
    gridLayout = new GridLayout();
    gridLayout.numColumns = 4;
    groupKeySequence.setLayout(gridLayout);
    gridData = new GridData(GridData.FILL_BOTH);
    groupKeySequence.setLayoutData(gridData);
    groupKeySequence.setText(Util.translateString(RESOURCE_BUNDLE,
        "groupKeySequence")); //$NON-NLS-1$ 
    final Label labelKeySequence = new Label(groupKeySequence, SWT.LEFT);
    gridData = new GridData();
    labelKeySequence.setLayoutData(gridData);
    labelKeySequence.setText(Util.translateString(RESOURCE_BUNDLE,
        "labelKeySequence")); //$NON-NLS-1$

    // The text widget into which the key strokes will be entered.
    textTriggerSequence = new Text(groupKeySequence, SWT.BORDER);
    // On MacOS X, this font will be changed by KeySequenceText
    textTriggerSequence.setFont(groupKeySequence.getFont());
    gridData = new GridData();
    gridData.horizontalSpan = 2;
    gridData.widthHint = 300;
    textTriggerSequence.setLayoutData(gridData);
    textTriggerSequence.addModifyListener(new ModifyListener() {
      public void modifyText(ModifyEvent e) {
        update();
      }
    });
    textTriggerSequence.addFocusListener(new FocusListener() {
      public void focusGained(FocusEvent e) {
        bindingService.setKeyFilterEnabled(false);
      }

      public void focusLost(FocusEvent e) {
        bindingService.setKeyFilterEnabled(true);
      }
    });
    textTriggerSequence.addDisposeListener(new DisposeListener() {
      public void widgetDisposed(DisposeEvent e) {
        if (!bindingService.isKeyFilterEnabled()) {
          bindingService.setKeyFilterEnabled(true);
        }
      }
    });

    // The manager for the key sequence text widget.
    textTriggerSequenceManager = new KeySequenceText(textTriggerSequence);
    textTriggerSequenceManager.setKeyStrokeLimit(4);

    // Button for adding trapped key strokes
    final Button buttonAddKey = new Button(groupKeySequence, SWT.LEFT
        | SWT.ARROW);
    buttonAddKey.setToolTipText(Util.translateString(RESOURCE_BUNDLE,
        "buttonAddKey.ToolTipText")); //$NON-NLS-1$
    gridData = new GridData();
    gridData.heightHint = comboCategory.getTextHeight();
    buttonAddKey.setLayoutData(gridData);

    // Arrow buttons aren't normally added to the tab list. Let's fix that.
    final Control[] tabStops = groupKeySequence.getTabList();
    final ArrayList newTabStops = new ArrayList();
    for (int i = 0; i < tabStops.length; i++) {
      Control tabStop = tabStops[i];
      newTabStops.add(tabStop);
      if (textTriggerSequence.equals(tabStop)) {
        newTabStops.add(buttonAddKey);
      }
    }
    final Control[] newTabStopArray = (Control[]) newTabStops
        .toArray(new Control[newTabStops.size()]);
    groupKeySequence.setTabList(newTabStopArray);

    // Construct the menu to attach to the above button.
    final Menu menuButtonAddKey = new Menu(buttonAddKey);
    final Iterator trappedKeyItr = KeySequenceText.TRAPPED_KEYS.iterator();
    while (trappedKeyItr.hasNext()) {
      final KeyStroke trappedKey = (KeyStroke) trappedKeyItr.next();
      final MenuItem menuItem = new MenuItem(menuButtonAddKey, SWT.PUSH);
      menuItem.setText(trappedKey.format());
      menuItem.addSelectionListener(new SelectionAdapter() {

        public void widgetSelected(SelectionEvent e) {
          textTriggerSequenceManager.insert(trappedKey);
          textTriggerSequence.setFocus();
          textTriggerSequence.setSelection(textTriggerSequence
              .getTextLimit());
        }
      });
    }
    buttonAddKey.addSelectionListener(new SelectionAdapter() {

      public void widgetSelected(SelectionEvent selectionEvent) {
        Point buttonLocation = buttonAddKey.getLocation();
        buttonLocation = groupKeySequence.toDisplay(buttonLocation.x,
            buttonLocation.y);
        Point buttonSize = buttonAddKey.getSize();
        menuButtonAddKey.setLocation(buttonLocation.x, buttonLocation.y
            + buttonSize.y);
        menuButtonAddKey.setVisible(true);
      }
    });

    labelBindingsForTriggerSequence = new Label(groupKeySequence, SWT.LEFT);
    gridData = new GridData(GridData.VERTICAL_ALIGN_BEGINNING);
    gridData.verticalAlignment = GridData.FILL_VERTICAL;
    labelBindingsForTriggerSequence.setLayoutData(gridData);
    labelBindingsForTriggerSequence.setText(Util.translateString(
        RESOURCE_BUNDLE, "labelAssignmentsForKeySequence")); //$NON-NLS-1$
    tableBindingsForTriggerSequence = new Table(groupKeySequence,
        SWT.BORDER | SWT.FULL_SELECTION | SWT.H_SCROLL | SWT.V_SCROLL);
    tableBindingsForTriggerSequence.setHeaderVisible(true);
    gridData = new GridData(GridData.FILL_BOTH);
    gridData.heightHint = 60;
    gridData.horizontalSpan = 3;
    gridData.widthHint = "carbon".equals(SWT.getPlatform()) ? 620 : 520; //$NON-NLS-1$
    tableBindingsForTriggerSequence.setLayoutData(gridData);
    tableColumnDelta = new TableColumn(tableBindingsForTriggerSequence,
        SWT.NULL, 0);
    tableColumnDelta.setResizable(false);
    tableColumnDelta.setText(Util.ZERO_LENGTH_STRING);
    tableColumnDelta.setWidth(20);
    tableColumnContext = new TableColumn(tableBindingsForTriggerSequence,
        SWT.NULL, 1);
    tableColumnContext.setResizable(true);
    tableColumnContext.setText(Util.translateString(RESOURCE_BUNDLE,
        "tableColumnContext")); //$NON-NLS-1$
    tableColumnContext.pack();
    tableColumnContext.setWidth(200);
    final TableColumn tableColumnCommand = new TableColumn(
        tableBindingsForTriggerSequence, SWT.NULL, 2);
    tableColumnCommand.setResizable(true);
    tableColumnCommand.setText(Util.translateString(RESOURCE_BUNDLE,
        "tableColumnCommand")); //$NON-NLS-1$
    tableColumnCommand.pack();
    tableColumnCommand.setWidth(300);

    tableBindingsForTriggerSequence.addMouseListener(new MouseAdapter() {

      public void mouseDoubleClick(MouseEvent mouseEvent) {
        update();
      }
    });
View Full Code Here

        gd = new GridData(GridData.FILL_HORIZONTAL);
        Button addDirButton = new Button(container,SWT.PUSH);
        addDirButton.setLayoutData(gd);
        addDirButton.setText(CodegenWizardPlugin
                .getResourceString("page4.addDir.label"));
        addDirButton.addMouseListener(new MouseAdapter(){
          public void mouseUp(MouseEvent e) {
            handleDirectoryBrowse();
          }
        });
       
        gd = new GridData(GridData.FILL_HORIZONTAL);
        Button addJarButton = new Button(container,SWT.PUSH);
        addJarButton.setLayoutData(gd);
        addJarButton.setText(CodegenWizardPlugin
                .getResourceString("page4.addJar.label"));
        addJarButton.addMouseListener(new MouseAdapter(){
          public void mouseUp(MouseEvent e) {
            handleFileBrowse();
          }
        });
       
        gd = new GridData(GridData.FILL_HORIZONTAL);
        Button removeEntryButton = new Button(container,SWT.PUSH);
        removeEntryButton.setLayoutData(gd);
        removeEntryButton.setText(CodegenWizardPlugin
                .getResourceString("page4.removeEntry.label"));
        removeEntryButton.addMouseListener(new MouseAdapter(){
          public void mouseUp(MouseEvent e) {
            handleRemove();
          }
        });
       
        gd = new GridData(GridData.FILL_HORIZONTAL);
        gd.horizontalSpan = 3;
        gd.verticalSpan = 7;
        javaClasspathList = new List(container,SWT.READ_ONLY | SWT.BORDER);
        javaClasspathList.setLayoutData(gd);
        javaClasspathList.setItems(settings.getArray(JAVA_CLASS_PATH_ENTRIES));
       
        gd = new GridData(GridData.FILL_HORIZONTAL);
        Button tryLoadButton = new Button(container,SWT.PUSH);
        tryLoadButton.setLayoutData(gd);
        tryLoadButton.setText(CodegenWizardPlugin
                .getResourceString("page4.tryLoad.label"));
        tryLoadButton.addMouseListener(new MouseAdapter(){
          public void mouseUp(MouseEvent e) {
            java.util.List errorListener = new ArrayList();
            if (!ClassFileReader.tryLoadingClass(getClassName(),
                getClassPathList(),
                errorListener)){
View Full Code Here

    Composite composite_1 = new Composite(shell, SWT.NONE);
    composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
   
    Button btnOk = new Button(composite_1, SWT.NONE);
    btnOk.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent arg0) {
        String name = text_3.getText();
        String host = text_4.getText();
        String port = text_5.getText();
        String password= text_6.getText();
        if(name.length() == 0 || host.length() == 0 || port.length() == 0)
          MessageDialog.openError(shell, RedisClient.i18nFile.getText(I18nFile.ERROR),RedisClient.i18nFile.getText(I18nFile.INPUTSERVER));
        else {
          result = new Server(0, name, host, port, password);
          shell.dispose();
        }
         
         
      }
    });
    btnOk.setText(RedisClient.i18nFile.getText(I18nFile.OK));
   
    Button btnCancel = new Button(composite_1, SWT.NONE);
    btnCancel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent arg0) {
        shell.dispose();
      }
    });
View Full Code Here

    composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, false, true, 1, 1));
   
   
    Button button = new Button(composite_1, SWT.NONE);
    button.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        String name = text_2.getText();
       
        if( name.length() == 0 ){
          MessageDialog.openError(shell, RedisClient.i18nFile.getText(I18nFile.ERROR),RedisClient.i18nFile.getText(I18nFile.INPUTFAVORITE));
        } else {
          result = name;
          shell.dispose();
        }
      }
    });
    button.setText(RedisClient.i18nFile.getText(I18nFile.OK));
   
    Button button_1 = new Button(composite_1, SWT.NONE);
    button_1.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        shell.dispose();
      }
    });
View Full Code Here

    Composite composite_1 = new Composite(shell, SWT.NONE);
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.BOTTOM, false, true, 1, 1));
    composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
   
    Button button = new Button(composite_1, SWT.NONE);
    button.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        String name = text_2.getText();
       
        if( name.length() == 0){
          MessageDialog.openError(shell, RedisClient.i18nFile.getText(I18nFile.ERROR),RedisClient.i18nFile.getText(I18nFile.INPUTFAVORITE));
        } else {
          result = name;
          shell.dispose();
        }
      }
    });
    button.setText(RedisClient.i18nFile.getText(I18nFile.OK));
   
    Button button_1 = new Button(composite_1, SWT.NONE);
    button_1.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        shell.dispose();
      }
    });
View Full Code Here

    Composite composite_1 = new Composite(shell, SWT.NONE);
    composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 1, 1));
   
    Button btnOk = new Button(composite_1, SWT.NONE);
    btnOk.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent arg0) {
        if((Boolean) t1.getData()){
          int time1;
          try{
            time1 = Integer.parseInt(t1.getText());
          }catch(NumberFormatException e){
            throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.TIMEEXCEPTION));
          }
         
          if(time1 <= 0)
            throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.TIMEEXCEPTION));
         
          ConfigFile.setT1(time1);
          JedisCommand.timeout = ConfigFile.getT1();
        }
       
        if((Boolean) t2.getData()){
          int time2;
          try{
            time2 = Integer.parseInt(t2.getText());
          }catch(NumberFormatException e){
            throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.TIMEEXCEPTION));
          }
         
          if(time2 <= 0)
            throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.TIMEEXCEPTION));
         
          ConfigFile.setT2(time2);
        }
       
        if((Boolean) separator.getData()){
          String sep = separator.getText();
          if(sep.length() == 0)
            sep = ConfigFile.SEP;
         
          ConfigFile.setSeparator(sep);
        }
       
        if((Boolean) size.getData()){
          int psize;
          try{
            psize = Integer.parseInt(size.getText());
          }catch(NumberFormatException e){
            throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SIZEEXCEPTION));
          }
         
          if(psize <= 0)
            throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SIZEEXCEPTION));
         
          ConfigFile.setPagesize(psize);
          PagingListener.PAGE_SIZE = ConfigFile.getPagesize();
       
       
        shell.dispose()
      }
    });
    btnOk.setText(RedisClient.i18nFile.getText(I18nFile.OK));
   
    Button btnCancel = new Button(composite_1, SWT.NONE);
    btnCancel.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent arg0) {
        shell.dispose();
      }
    });
View Full Code Here

    Composite composite_1 = new Composite(shell, SWT.NONE);
    composite_1.setLayoutData(new GridData(SWT.CENTER, SWT.CENTER, false, false, 2, 1));
    composite_1.setLayout(new FillLayout(SWT.HORIZONTAL));
   
    Button button = new Button(composite_1, SWT.NONE);
    button.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        if(btnDeleteSubcontainerUnder!= null)
          result = btnDeleteSubcontainerUnder.getSelection();
        else
          result = false;
       
        shell.dispose();
      }
    });
    button.setText(RedisClient.i18nFile.getText(I18nFile.OK));
   
    Button button_1 = new Button(composite_1, SWT.NONE);
    button_1.addMouseListener(new MouseAdapter() {
      @Override
      public void mouseUp(MouseEvent e) {
        shell.dispose();
      }
    });
View Full Code Here

TOP

Related Classes of org.eclipse.swt.events.MouseAdapter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.