Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.InputDialog


  /**
   * Adds new {@link CategoryInfo}.
   */
  private void onAddCategory() {
    InputDialog inputDialog =
        new InputDialog(getShell(), "New category", "Enter new category name:", "", null);
    if (inputDialog.open() == Window.OK) {
      commands_add(new CategoryAddCommand("category_" + System.currentTimeMillis(),
          inputDialog.getValue()));
    }
  }
View Full Code Here


   */
  private void onEdit() {
    Object element = getSelectedElements().get(0);
    if (element instanceof CategoryInfo) {
      CategoryInfo category = (CategoryInfo) element;
      InputDialog inputDialog =
          new InputDialog(getShell(),
              "Category",
              "Enter new category name:",
              category.getName(),
              null);
      // execute dialog
      if (inputDialog.open() == Window.OK) {
        commands_add(new CategoryNameCommand(category, inputDialog.getValue()));
      }
    } else if (element instanceof DeviceInfo) {
      DeviceInfo device = (DeviceInfo) element;
      DeviceEditDialog dialog = new DeviceEditDialog(device);
      // execute dialog
View Full Code Here

                if (selectionIndex != -1)
                {
                    final CompositeData selectedLogger = (CompositeData)_table.getItem(
                                                                        selectionIndex).getData();
                    String user = selectedLogger.get(USERNAME).toString();
                    InputDialog id = new InputDialog(setPasswordButton.getShell(),"Set Password",
                                        "Please enter the new password for '" + user + "':",null,null){
                        @Override
                        protected Control createDialogArea(Composite parent)
                        {
                            Control control = super.createDialogArea(parent);
                            //set the Text field echo char to '*' to mask the password
                            getText().setEchoChar('*');
                            //return the normal result
                            return control;
                        }
                    };
                   
                    int returnValue;
                    while((returnValue = id.open()) == InputDialog.OK)
                    {
                        if (id.getValue() == null || id.getValue().toString().length() == 0)
                        {                           
                            ViewUtility.popupErrorMessage("Set Password", "Please enter a valid password");                      
                        }
                        else
                        {
                            break;
                        }
                    }
                   
                    if (returnValue  == InputDialog.OK)
                    {
                        char[] passwordArray = id.getValue().toCharArray();

                        // Qpid JMX API 1.1 and below expects the password to be sent as a hashed value.
                        if (_ApiVersion.lessThanOrEqualTo(1,1))
                        {
                            try
                            {
                                passwordArray = ViewUtility.getHash(id.getValue());
                            }
                            catch (Exception hashException)
                            {
                                ViewUtility.popupErrorMessage("Set Password",
                                        "Unable to calculate hash for Password:"
                                        + hashException.getMessage());
                                return;
                            }
                        }

                        try
                        {
                            boolean result;

                            //For Qpid JMX API >=1.7 use String based method instead of older char[] based method.
                            if(_ApiVersion.greaterThanOrEqualTo(1, 7))
                            {
                                result = _ummb.setPassword(user, id.getValue());
                            }
                            else
                            {
                                result = _ummb.setPassword(user, passwordArray);
                            }
View Full Code Here

   *
   * @see java.lang.Runnable#run()
   */
  @Override
  public void run() {
    InputDialog dlg = new InputDialog(
        Display.getCurrent().getActiveShell(), "Create new Java class",
        "Enter a name for the enclosing Java class:", "", null);
    if (dlg.open() == InputDialog.OK) {
      className = dlg.getValue();
      logger.debug("Classname: " + dlg.getValue());
    } else {
      logger.debug("Do not create a class.");
    }
  }
View Full Code Here

    Button btnAdd = new Button(grpValues, SWT.NONE);
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnAdd.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog inputDialog = new InputDialog((Shell) shell,
            RedisClient.i18nFile.getText(I18nFile.INPUTVALUES),
            RedisClient.i18nFile.getText(I18nFile.LISTINPUTFORMAT), "", null);
        if (inputDialog.open() == InputDialog.OK) {
          String values = inputDialog.getValue();
          String[] listValues = values.split(";");
          TableItem item = null;
         
          for (String value : listValues) {
            item = new TableItem(table, SWT.NONE);
View Full Code Here

    Button btnAdd = new Button(grpValues, SWT.NONE);
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnAdd.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog inputDialog = new InputDialog(
            (Shell) shell,
            RedisClient.i18nFile.getText(I18nFile.INPUTVALUES),
            RedisClient.i18nFile.getText(I18nFile.INPUTZSETFORMAT),
            "", null);
        if (inputDialog.open() == InputDialog.OK) {
          String values = inputDialog.getValue();
          String[] zsetValues = values.split(";");
          TableItem item = null;
          for (String value : zsetValues) {
            item = new TableItem(table, SWT.NONE);
            String[] zset = value.split(",");
View Full Code Here

    btnInsertHead = new Button(grpValues, SWT.NONE);
    btnInsertHead.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnInsertHead.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog dialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INSERTHEAD), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), "", null);
        if(dialog.open() == InputDialog.OK){
            String value = dialog.getValue();
            service.addHead(id, db, key, value);
            refresh();
        }
      }
    });
    btnInsertHead.setText(RedisClient.i18nFile.getText(I18nFile.INSERTHEAD));

    btnAppendTail = new Button(grpValues, SWT.NONE);
    btnAppendTail.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false,
        1, 1));
    btnAppendTail.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog dialog = new InputDialog(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.APPENDTAIL), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), "", null);
        if(dialog.open() == InputDialog.OK){
            String value = dialog.getValue();
            service.addTail(id, db, key, value);
            pageListener.setCount();
            table.clear(table.getItemCount()-1);
            table.setSelection(table.getItemCount()-1);
            table.setSelection(-1);
            currentData.setItem(null);
            status = Status.Normal;
          statusChanged();
        }
      }
    });
    btnAppendTail.setText(RedisClient.i18nFile.getText(I18nFile.APPENDTAIL));

    btnDeleteHead = new Button(grpValues, SWT.NONE);
    btnDeleteHead.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnDeleteHead.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        service.removeFirst(id, db, key);
        refresh();
      }
    });
    btnDeleteHead.setText(RedisClient.i18nFile.getText(I18nFile.DELETEHEAD));

    btnDeleteTail = new Button(grpValues, SWT.NONE);
    btnDeleteTail.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1,
        1));
    btnDeleteTail.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        service.removeLast(id, db, key);
        pageListener.setCount();
        table.getItem(table.getItemCount()-1);
        table.setSelection(table.getItemCount()-1);
          table.setSelection(-1);
          currentData.setItem(null);
          status = Status.Normal;
        statusChanged();
      }
    });
    btnDeleteTail.setText(RedisClient.i18nFile.getText(I18nFile.DELETETAIL));
   
    btnApply = new Button(grpValues, SWT.NONE);
    btnApply.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        TableItem[] items = table.getSelection();
        service.setValue(id, db, key, table.getSelectionIndex(), items[0].getText());
        table.setSelection(-1);
        currentData.setItem(null);
        status = Status.Normal;
        statusChanged();
      }
    });
    btnApply.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    setApply(false);
    btnApply.setText(RedisClient.i18nFile.getText(I18nFile.APPLY));
   
    btnCancel = new Button(grpValues, SWT.NONE);
    btnCancel.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        switch(status){
        case Normal:
          break;
        case Update:
          table.setSelection(-1);
          status = Status.Normal;
          currentData.setItem(null);
          statusChanged();
          break;
        case Updating:
          currentData.reset();
          status = Status.Update;
          listener.clickRow(currentData.getItem(), 0);
          addModifyTextListener();
          statusChanged();
          break;
        }
       
      }
    });
    btnCancel.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnCancel.setEnabled(false);
    btnCancel.setText(RedisClient.i18nFile.getText(I18nFile.CANCEL));
   
    btnRefresh = new Button(grpValues, SWT.NONE);
    btnRefresh.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        refresh();
      }
    });
    btnRefresh.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnRefresh.setEnabled(true);
    btnRefresh.setText(RedisClient.i18nFile.getText(I18nFile.REFRESH));

    btnWatch = new Button(grpValues, SWT.NONE);
    btnWatch.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnWatch.setText(RedisClient.i18nFile.getText(I18nFile.WATCH));
    btnWatch.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        WatchDialog dialog = new WatchDialog(shell.getParent()
            .getShell(), image, currentData.getValue());
        dialog.open();
      }
    });
   
   
   
View Full Code Here

    btnAdd = new Button(grpValues, SWT.NONE);
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnAdd.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog inputDialog = new InputDialog(shell.getParent().getShell(),
            RedisClient.i18nFile.getText(I18nFile.INPUTVALUES),
            RedisClient.i18nFile.getText(I18nFile.LISTINPUTFORMAT), "", null);
        if (inputDialog.open() == InputDialog.OK) {
          String values = inputDialog.getValue();
          String[] setValues = values.split(";");
          long size = service.addValues(id, db, key, setValues);
          if(size == 0)
            MessageDialog.openInformation(shell.getParent().getShell(), RedisClient.i18nFile.getText(I18nFile.INPUTVALUES), RedisClient.i18nFile.getText(I18nFile.ADDSETVALUES));
          refresh();
View Full Code Here

    Button btnAdd = new Button(grpValues, SWT.NONE);
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnAdd.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog inputDialog = new InputDialog((Shell) shell,
            RedisClient.i18nFile.getText(I18nFile.INPUTVALUES),
            RedisClient.i18nFile.getText(I18nFile.LISTINPUTFORMAT), "", null);
        if (inputDialog.open() == InputDialog.OK) {
          String values = inputDialog.getValue();
          String[] listValues = values.split(";");
          TableItem item = null;
          for (String value : listValues) {
            item = new TableItem(table, SWT.NONE);
            item.setText(value);
View Full Code Here

    Button btnAdd = new Button(grpValues, SWT.NONE);
    btnAdd.setLayoutData(new GridData(SWT.FILL, SWT.TOP, false, false, 1, 1));
    btnAdd.addSelectionListener(new SelectionAdapter() {
      @Override
      public void widgetSelected(SelectionEvent e) {
        InputDialog inputDialog = new InputDialog(
            (Shell) shell,
            RedisClient.i18nFile.getText(I18nFile.INPUTVALUES),
            RedisClient.i18nFile.getText(I18nFile.HASHINPUTFORMAT),
            "", null);
        if (inputDialog.open() == InputDialog.OK) {
          String values = inputDialog.getValue();
          String[] hashValues = values.split(";");
          TableItem item = null;
          for (String value : hashValues) {
            item = new TableItem(table, SWT.NONE);
            String[] zset = value.split(",");
View Full Code Here

TOP

Related Classes of org.eclipse.jface.dialogs.InputDialog

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.