Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.InputDialog


         
          autoJoin.setSelection(MUCUtils.isOnAutoJoinList(MUCBrowserGUI.this.account,muc.getRoom()));
         
          changeTopic.addListener(SWT.Selection,new Listener() {
            public void handleEvent(Event event) {
              InputDialog inputDialog = new InputDialog(txtTopic.getShell(),
                  "Change Subject",
                  "Enter a new Subject for the room " + muc.getRoom(),
                  txtTopic.getText(),
                  null);
              int r = inputDialog.open();
              if(r != InputDialog.OK) return;
              try {
                muc.changeSubject(inputDialog.getValue());
              } catch (XMPPException e) {
                e.printStackTrace();
                String msg = e.getMessage();
                if(e.getXMPPError() != null) {
                  msg = JabberErrorConditionMapping.getMeaning(e.getXMPPError().getCode());
                  if(e.getXMPPError().getMessage() != null)
                    msg = msg + " - " + e.getXMPPError().getMessage();
                }
                throw new RuntimeException(msg,e);
              }
            }
          });
          invite.addListener(SWT.Selection,new Listener() {
            public void handleEvent(Event event) {
              InputDialog inputDialog = new InputDialog(txtTopic.getShell(),
                  "Invite Someone",
                  "Enter JID of whom you want to invite to this Room (Afterwards you can enter an invite message)",
                  "",
                  null);
              int r = inputDialog.open();
              if(r != InputDialog.OK) return;
              String jid = inputDialog.getValue();
              inputDialog = new InputDialog(txtTopic.getShell(),
                  "Invite Someone",
                  "Enter Invite Message (Reason for the invitation)",
                  "Join me on " + muc.getRoom(),
                  null);
              r = inputDialog.open();
              if(r != InputDialog.OK) return;
              String reason = inputDialog.getValue();
              muc.invite(jid,reason);
            }
          });
          autoJoin.addListener(SWT.Selection,new Listener() {
            public void handleEvent(Event event) {
View Full Code Here


public class CopyPlaylistHandler extends AbstractHandler implements IHandler {

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    InputDialog dialog = new InputDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),
                      Messages.getString("CopyPlaylistHandler.Title"), Messages.getString("CopyPlaylistHandler.Question"), Messages.getString("CopyPlaylistHandler.DefaultValue"), new PlaylistNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
   
    int result = dialog.open();
   
    if (result == InputDialog.OK) {
     
      String playlistName;
      IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();           
                 
      playlistName = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActivePart().getTitle();
      if (page.findViewReference(PlaylistView.ID, playlistName) == null) {
        playlistName = Constants.DEFAULT_PLAYLIST_ID;
      }
     
      Controller.getInstance().getPlaylistController().duplicatePlaylist(dialog.getValue(), playlistName);                       

      try {
        page.showView(PlaylistView.ID, dialog.getValue(), IWorkbenchPage.VIEW_ACTIVATE);
      } catch (PartInitException e) {
        Log.getInstance(CopyPlaylistHandler.class).error(e.getMessage());
      }
    }
View Full Code Here

 
  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
   
    InputDialog dialog = new InputDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),
        Messages.getString("MenuRenamePlaylistHandler.Title"), Messages.getString("MenuRenamePlaylistHandler.Question"), Messages.getString("MenuCopyPlaylistHandler.DefaultValue"), new PlaylistNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    int result = dialog.open();

    if (result == InputDialog.OK) {
     
      ISelection selection = window.getActivePage().getSelection();
     
      Object obj = ((IStructuredSelection) selection).getFirstElement();
     
      if (obj != null) {
        closeViewByID(((Playlist ) obj).getName());
        Controller.getInstance().getPlaylistController().renamePlaylist(dialog.getValue(), ((Playlist) obj).getName());               
      }     
    }
    return null;
  }
View Full Code Here

        ISelection selection = viewer.getSelection();
        Object obj = ((IStructuredSelection)selection).getFirstElement();
       
        if (obj != null) {
          String oldName = ((Podcast) obj).getName();
          InputDialog dialog = new InputDialog(_parent.getShell(),
              Messages.getString("PodcastListView.RenameDialogTitle"), Messages.getString("PodcastListView.RenameDialogQuestion"), oldName, new PodcastNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

          int result = dialog.open();

          if (result == InputDialog.OK) {
            ApplicationUtils.closeViewByID(PodcastView.ID, oldName);
            Controller.getInstance().getPlaylistController().renamePodcast(dialog.getValue(), oldName);
          }
        }
      }   
    });
   
View Full Code Here

  @Override
  public Object execute(ExecutionEvent event) throws ExecutionException {
   
    IWorkbenchWindow window = HandlerUtil.getActiveWorkbenchWindow(event);
   
    InputDialog dialog = new InputDialog(HandlerUtil.getActiveWorkbenchWindow(event).getShell(),
        Messages.getString("MenuCopyPlaylistHandler.Title"), Messages.getString("MenuCopyPlaylistHandler.Question"), Messages.getString("MenuCopyPlaylistHandler.DefaultValue"), new PlaylistNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    int result = dialog.open();

    if (result == InputDialog.OK) {
     
      ISelection selection = window.getActivePage().getSelection();
     
      Object obj = ((IStructuredSelection) selection).getFirstElement();
     
      if (obj != null) {
        Controller.getInstance().getPlaylistController().duplicatePlaylist(dialog.getValue(), ((Playlist) obj).getName());
       
        IWorkbenchPage page = window.getActivePage();             

        try {
          page.showView(PlaylistView.ID, dialog.getValue(), IWorkbenchPage.VIEW_ACTIVATE);
        } catch (PartInitException e) {
          Log.getInstance(MenuCopyPlaylistHandler.class).error(e.getMessage());
        }
      }     
    }
View Full Code Here

      _newPlaylist = Messages.getString("NewPlaylistAction.DefaultName"); //$NON-NLS-1$
    _shell = shell;
  }
 
  public void run() {
    InputDialog dialog = new InputDialog(_shell,
        Messages.getString("NewPlaylistAction.Title"), Messages.getString("NewPlaylistAction.Question"), _newPlaylist, new PlaylistNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    int result = dialog.open();

    if (result == InputDialog.OK) {
      _newPlaylist = dialog.getValue();
      Controller.getInstance().getPlaylistController().addEmptyPlaylist(_newPlaylist);
      Log.getInstance(NewPlaylistHandler.class).debug("New playlist added : " + _newPlaylist); //$NON-NLS-1$
    } else {
      _newPlaylist = null;
    }
View Full Code Here

    return result.toString();
  }

  @Override
  protected String getNewInputObject() {
    InputDialog dialog = new InputDialog(getShell(), Messages.getString("RegExPatternListEditor.DialogTitle"), Messages.getString("RegExPatternListEditor.DialogText"), "", new RegexPatternValidator());
   
    if (dialog.open() == InputDialog.OK) {
      return dialog.getValue();
    } else {
      return null;
    }     
  }
View Full Code Here

      Controller.getInstance().getEqualizerController().deletePreset(presetName);
    }
  }
 
  private void savePreset() {
    InputDialog dialog = new InputDialog(_shell,
        Messages.getString("EqualizerView.PresetTitle"), //$NON-NLS-1$
        Messages.getString("EqualizerView.PresetQuestion"), //$NON-NLS-1$
        Messages.getString("EqualizerView.PresetDefaultName"), //$NON-NLS-1$
        new PresetNameValidator()); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$

    int result = dialog.open();

    if (result == InputDialog.OK) {
      Controller.getInstance().getEqualizerController().addPreset(dialog.getValue(),
          valueToDb(scBand0.getSelection()),
              valueToDb(scBand1.getSelection()),
                  valueToDb(scBand2.getSelection()),
                      valueToDb(scBand3.getSelection()),
                          valueToDb(scBand4.getSelection()),
View Full Code Here

   
    FileTransferManager manager = new FileTransferManager(account.xmpp.getConnection());
    final OutgoingFileTransfer outgoingFileTransfer = manager.createOutgoingFileTransfer(user);
   
    final File f = new File(file);
    InputDialog descriptionInput = new InputDialog(parent,
        "Sending file to " + user,
        "Please Provide a description of the file (" + f.getName() + ") " +
          "you want to send to " + user,
        "",null);
    if(descriptionInput.open() != InputDialog.OK) return false;
    try {
      outgoingFileTransfer.sendFile(f,descriptionInput.getValue());
     
      final String task = "Sending file " + f.getName() + " to " + user;
      showProgressMonitor(parent, outgoingFileTransfer, task);
    } catch (Exception e) {
      throw new RuntimeException("Error while trying to send file.",e);
View Full Code Here

        btnAddPattern.setText(Messages.TapestryFacetInstallPage_Add2);
        btnAddPattern.setLayoutData(new GridData(GridData.FILL_HORIZONTAL
            | GridData.VERTICAL_ALIGN_BEGINNING));
        btnAddPattern.addSelectionListener(new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            InputDialog dialog = new InputDialog(getShell(),
                Messages.TapestryFacetInstallPage_PatternDialogTitle,
                Messages.TapestryFacetInstallPage_PatternDialogDesc, null,
                new IInputValidator() {
   
                  public String isValid(String newText) {
                    return isValidPattern(newText);
                  }
   
                });
            dialog.open();
            if (dialog.getReturnCode() == Window.OK) {
              addItemToList(dialog.getValue(), true);
            }
          }
        });
   
        btnRemovePattern = new Button(btnComposite, SWT.NONE);
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.