Package org.eclipse.jface.dialogs

Examples of org.eclipse.jface.dialogs.IDialogSettings


        try {
            if (!canConnect()) {
                return false;
            } else {
                setErrorMessage(null);
                IDialogSettings section = getDialogSettings().getSection(PREVIOUS_CONNECTIONS);
                if (section == null) {
                    section = getDialogSettings().addNewSection(PREVIOUS_CONNECTIONS);
                }

                IDialogSettings[] allSections = section.getSections();
                IDialogSettings match = findMatchForCurrent(allSections);
                if (match != null) {
                    if( savePassword.getSelection() ){
                        String storedPass = match.get(PASSWORD);
                        if( !password.getText().equals(storedPass) ){
                            if( storedPass==null || storedPass.length()==0 ){
                                match.put(PASSWORD, password.getText());
                            }else {
                                boolean choice = MessageDialog.openConfirm(getShell(), localization.password, localization.changePasswordQuery);
                                if( choice ){
                                    match.put(PASSWORD, password.getText());                                   
                                }
                            }
                        }
                       
                    }else{
                        match.put(PASSWORD, ""); //$NON-NLS-1$
                    }
                   
                    match.put(SAVE_PASSWORD, savePassword.getSelection());
                    match.put(TIMESTAMP, System.currentTimeMillis());
                } else {
                    IDialogSettings params = section.addNewSection(allSections.length + 1 + ""); //$NON-NLS-1$
                    params.put(HOST, host.getText());
                    params.put(PORT, port.getText());
                    params.put(USERNAME, username.getText());
                    params.put(TIMESTAMP, System.currentTimeMillis());
                    params.put(SAVE_PASSWORD, savePassword.getSelection());
                    if ( savePassword.getSelection() ){
                        params.put(PASSWORD, password.getText());
                    }
                }

                return true;
            }
View Full Code Here


     * Get the preferences search history for this eclipse's start,
     * Note that this history will not be cleared until this eclipse closes
     *
     */
    public void getPreferenceSearchHistory(){      
        IDialogSettings settings = getDialogSettings();
        String[] search = settings.getArray(SEARCHHISTORY);
       
        if(search == null)
            return;
       
        for(int i = 0; i < search.length;i++){
View Full Code Here

   
     /**
     * Saves the search history.
     */
    private void saveDialogSettings() {  
        IDialogSettings settings =getDialogSettings();
       
        //If the settings contains the same key, the previous value will be replaced by new one
        settings.put(SEARCHHISTORY,filterCombo.getItems());
              
    }
View Full Code Here

    super(JApplet.class.getName());
  }

  @Override
  public IDialogSettings getDialogSettings() {
    IDialogSettings dialogSettings2 = super.getDialogSettings();
    IDialogSettings section = dialogSettings2.getSection(NewComponentPage.PAGE_NAME);
    if (section == null) {
      section = new DialogSettings(NewComponentPage.PAGE_NAME);
      dialogSettings2.addSection(section);
    }
    section.put(NewComponentPage.SETTINGS_CREATEMAIN, false);
    return dialogSettings2;
  }
View Full Code Here

    }
    return true;
  }

  public boolean isDialogEnabled(String key) {
    IDialogSettings settings = getDialogSettings();
    return !settings.getBoolean(key);
  }
View Full Code Here

  public NewDialogCreationWizard() {
    super(JDialog.class.getName());
  }
  @Override
  public IDialogSettings getDialogSettings() {
    IDialogSettings dialogSettings2 = super.getDialogSettings();
    IDialogSettings section = dialogSettings2.getSection(NewComponentPage.PAGE_NAME);
    if (section == null) {
      section = new DialogSettings(NewComponentPage.PAGE_NAME);
      dialogSettings2.addSection(section);
    }
    section.put(NewComponentPage.SETTINGS_CREATEMAIN, true);
    return dialogSettings2;
  }
View Full Code Here

  public NewFrameCreationWizard() {
    super(JFrame.class.getName());
  }
  @Override
  public IDialogSettings getDialogSettings() {
    IDialogSettings dialogSettings2 = super.getDialogSettings();
    IDialogSettings section = dialogSettings2.getSection(NewComponentPage.PAGE_NAME);
    if (section == null) {
      section = new DialogSettings(NewComponentPage.PAGE_NAME);
      dialogSettings2.addSection(section);
    }
    section.put(NewComponentPage.SETTINGS_CREATEMAIN, true);
    return dialogSettings2;
  }
View Full Code Here

  final static String SETTINGS_CREATEUNIMPLEMENTED = "create_unimplemented"; //$NON-NLS-1$
  final static String SETTINGS_SUPERCLASSNAME = "super_class_name";

  @Override
  public void setSuperClass(String name, boolean canBeModified) {
    IDialogSettings section = getDialogSettings().getSection(PAGE_NAME);
    if (section != null) {
      name = section.get(SETTINGS_SUPERCLASSNAME);
      super.setSuperClass(name, isCanBeModified());
    } else {
      super.setSuperClass("javax.swing.JPanel", isCanBeModified());
    }
  }
View Full Code Here

  public NewCustomContainerWizard() {
    super(JPanel.class.getName());
  }
  @Override
  public IDialogSettings getDialogSettings() {
    IDialogSettings dialogSettings2 = super.getDialogSettings();
    IDialogSettings section = dialogSettings2.getSection(NewComponentPage.PAGE_NAME);
    if (section == null) {
      section = new DialogSettings(NewComponentPage.PAGE_NAME);
      dialogSettings2.addSection(section);
    }
    section.put(NewComponentPage.SETTINGS_CREATEMAIN, false);
    return dialogSettings2;
 
View Full Code Here

    addPage(fPage);
  }
  protected abstract NewComponentPage createPage();
  @Override
  public IDialogSettings getDialogSettings() {
    IDialogSettings settings = VisualSwingPlugin.getDefault().getDialogSettings();
    IDialogSettings section = settings.getSection(NewComponentPage.PAGE_NAME);
    if (section == null) {
      section = new DialogSettings(NewComponentPage.PAGE_NAME);
      settings.addSection(section);
    }
    section.put(NewComponentPage.SETTINGS_CREATECONSTR, false);
    section.put(NewComponentPage.SETTINGS_CREATEUNIMPLEMENTED, true);
    section.put(NewComponentPage.SETTINGS_SUPERCLASSNAME, superClassName);
    return settings;
  }
View Full Code Here

TOP

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

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.