When saving the Dialog
187011
function() {
		
		var newvalues, record;
		
	  	//Validate the Form
	  	if ( !this.dialog.getForm().validate() ) return ;
	   
		// Update the record
		if(!this.insertNewRecord){
						
			// Update the row
			newvalues = this.dialog.getValue();
			this.datatable.updateRow( this.selectedRecord , newvalues );

			// Get the new record
			record = this.datatable.getRecord(this.selectedRecord);
			
			// Fire the modify event
         this.itemModifiedEvt.fire(record);

		}
		// Adding new record
		else{
			// Insert a new row
	      this.datatable.addRow({});

			// Set the Selected Record
			var rowIndex = this.datatable.getRecordSet().getLength() - 1;
			this.selectedRecord = rowIndex;
			
			// Update the row
			newvalues = this.dialog.getValue();
			this.datatable.updateRow( this.selectedRecord , newvalues );
			
			// Get the new record
			record = this.datatable.getRecord(this.selectedRecord);
						
			// Fire the add event
         this.itemAddedEvt.fire(record);
		}
      
      this.dialog.hide();
   }
501700
private void buttonExportActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_buttonExportActionPerformed
    final File toSave = DialogProviderManager.getInstance().getDialogProvider().msgSaveFileDialog(null, "note-editor", UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.saveTitle"), null, true, TEXT_FILE_FILTER, "Save"); //NOI18N
    if (toSave != null) {
      try {
        final String text = getText();
        FileUtils.writeStringToFile(toSave, text, "UTF-8"); //NOI18N
      } catch (Exception ex) {
        LOGGER.error("Error during text file saving", ex); //NOI18N
        DialogProviderManager.getInstance().getDialogProvider().msgError(Main.getApplicationFrame(), UiUtils.BUNDLE.getString("PlainTextEditor.buttonSaveActionPerformed.msgError"));
      }
    }

  }
2279
def checkForSave( self ):
        
        # if the file is not modified, then save is not needed
        if ( not self.isModified() ):
            return True
        
        options     = QMessageBox.Yes | QMessageBox.No | QMessageBox.Cancel
        question    = 'Would you like to save your changes to %s?' % \
                                            self.windowTitle()
                                            
        answer      = QMessageBox.question( None, 
                                            'Save Changes', 
                                            question, 
                                            options )
        
        if ( answer == QMessageBox.Yes ):
            return self.save()
        elif ( answer == QMessageBox.Cancel ):
            return False
        return True
44073
void save() {

        saveAndDeleteEntities(false, new I_CmsSimpleCallback<Boolean>() {

            public void execute(Boolean hasChangedSettings) {

                setSaved();
                setUnchanged();
                m_hasChangedSettings = m_hasChangedSettings || hasChangedSettings.booleanValue();
            }
        });
    }
64816
def on_save_as(self):
        
        self.tabWidget.save_current_as()
        self._update_status_bar(self.tabWidget.current_widget())
464817
public void closeEditor() {

        if (m_saveButton != null) {
            if (m_saveButton.isEnabled()) {
                CmsConfirmDialog dialog = new CmsConfirmDialog(
                    org.opencms.gwt.client.Messages.get().key(org.opencms.gwt.client.Messages.GUI_DIALOG_RESET_TITLE_0),
                    Messages.get().key(Messages.GUI_CONFIRM_LEAVING_EDITOR_0));
                dialog.setHandler(new I_CmsConfirmDialogHandler() {

                    public void onClose() {

                        cancelEdit();
                    }

                    public void onOk() {

                        saveAndExit();
                    }
                });
                dialog.center();
            } else {
                cancelEdit();
            }
        }
    }
416799
protected void setSaveEnabled(boolean enabled, String disabledMessage) {

        if (m_saveButton != null) {
            if (enabled) {
                m_saveButton.enable();
            } else {
                m_saveButton.disable(disabledMessage);
            }
        }
    }
1177359
@Override
    public void onDialogClose(MAPDialog mapDialog) {
        if (logger.isDebugEnabled()) {
            logger.debug(String.format("DialogClose for Dialog=%d", mapDialog.getLocalDialogId()));
        }

    }
650779
void closeEditDialog() {

        if (m_dialogWindow != null) {
            m_dialogWindow.close();
            m_dialogWindow = null;
        }
        if (m_isOverView) {
            unlockCurrent();
            m_currentResource = null;
        }
    }
953675
def saveAs(self, path):
        
        if not path:
            path = self._dialogs.getSaveFileName(filter='*.csv')
        if path:
            self._setPath(path)
            with open(str(self._path), 'wb') as stream:
                writer = csv.writer(stream)
                table = self.table()
                for row in table:
                    writer.writerow(row)
796757
def _button_autosave_clicked(self, checked):
        
        if checked:
            # get the path from the user
            path = _spinmob.dialogs.save(filters=self.file_type)

            # abort if necessary
            if not path:
                self.button_autosave.set_checked(False)
                return

            # otherwise, save the info!
            self._autosave_directory, filename = _os.path.split(path)
            self._label_path.set_text(filename)

        self.save_gui_settings()
435051
def save(self):
        """"""
        if self.SacrificeDate:
            self.Active = False
        super(PlugEvents, self).save()
895170
function ( ) {
				_createDialog ( );
				
				// The dialog is displayed
				L.popup (
					{
						keepInView : true,
						closeButton : true,
						maxWidth : 600,
						className : 'PinEditDialog'
					}
				).setContent ( _MainDiv ).setLatLng( latlng ).openOn( Map );
				document.getElementById ( 'cyPinEditDialog-TextArea' ).focus ( );
			}
826853
void saveOU() {

        try {
            List<String> resources = new ArrayList<String>();
            for (I_CmsEditableGroupRow row : m_ouResources.getRows()) {
                resources.add(((CmsPathSelectField)row.getComponent()).getValue());
            }
            if (m_ou == null) {
                String parentOu = m_parentOu.getValue();
                if (!parentOu.endsWith("/")) {
                    parentOu += "/";
                }
                if (resources.contains("null")) {
                    resources.remove("null");
                }
                List<String> resourceNames = CmsFileUtil.removeRedundancies(resources);
                m_ou = OpenCms.getOrgUnitManager().createOrganizationalUnit(
                    m_cms,
                    parentOu + m_name.getValue(),
                    m_description.getValue(),
                    getFlags(),
                    resourceNames.isEmpty() ? null : resourceNames.get(0));

                if (!resourceNames.isEmpty()) {
                    resourceNames.remove(0);
                    Iterator<String> itResourceNames = CmsFileUtil.removeRedundancies(resourceNames).iterator();
                    while (itResourceNames.hasNext()) {
                        OpenCms.getOrgUnitManager().addResourceToOrgUnit(m_cms, m_ou.getName(), itResourceNames.next());
                    }
                }
            } else {
                m_ou.setDescription(m_description.getValue());
                m_ou.setFlags(getFlags());
                List<String> resourceNamesNew = CmsFileUtil.removeRedundancies(resources);
                List<CmsResource> resourcesOld = OpenCms.getOrgUnitManager().getResourcesForOrganizationalUnit(
                    m_cms,
                    m_ou.getName());
                List<String> resourceNamesOld = new ArrayList<String>();
                Iterator<CmsResource> itResourcesOld = resourcesOld.iterator();
                while (itResourcesOld.hasNext()) {
                    CmsResource resourceOld = itResourcesOld.next();
                    resourceNamesOld.add(m_cms.getSitePath(resourceOld));
                }
                Iterator<String> itResourceNamesNew = resourceNamesNew.iterator();
                // add new resources to ou
                while (itResourceNamesNew.hasNext()) {
                    String resourceNameNew = itResourceNamesNew.next();
                    if (!resourceNamesOld.contains(resourceNameNew)) {
                        OpenCms.getOrgUnitManager().addResourceToOrgUnit(m_cms, m_ou.getName(), resourceNameNew);
                    }
                }
                Iterator<String> itResourceNamesOld = resourceNamesOld.iterator();
                // delete old resources from ou
                while (itResourceNamesOld.hasNext()) {
                    String resourceNameOld = itResourceNamesOld.next();
                    if (!resourceNamesNew.contains(resourceNameOld)) {
                        OpenCms.getOrgUnitManager().removeResourceFromOrgUnit(m_cms, m_ou.getName(), resourceNameOld);
                    }
                }
                // write the edited organizational unit
                OpenCms.getOrgUnitManager().writeOrganizationalUnit(m_cms, m_ou);
            }
        } catch (CmsException e) {
            LOG.error("Unable to save OU", e);
        }
    }
1283022
def saved_dlg(self, message, caption='Saved:'):
        
        dlg = wx.MessageDialog(self, caption=caption,
                               message=message, style=wx.OK)
        result = self.show_dlg(dlg)
        dlg.Destroy()
426359
void callOnClose() {
        if (projectChanged && !SystemProperties.getBoolean("findbugs.skipSaveChangesWarning")) {
            Object[] options = {
                    L10N.getLocalString("dlg.save_btn", "Save"),
                    L10N.getLocalString("dlg.dontsave_btn", "Don't Save"),
                    L10N.getLocalString("dlg.cancel_btn", "Cancel"),
            };
            int value = JOptionPane.showOptionDialog(this, getActionWithoutSavingMsg("closing"),
                    L10N.getLocalString("msg.confirm_save_txt", "Do you want to save?"),
                    JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.QUESTION_MESSAGE, null, options, options[0]);

            if (value == 2 || value == JOptionPane.CLOSED_OPTION) {
                return;
            } else if (value == 0) {

                if (saveFile == null) {
                    if (!mainFrameLoadSaveHelper.saveAs()) {
                        return;
                    }
                } else {
                    mainFrameLoadSaveHelper.save();
                }
            }
        }

        GUISaveState guiSaveState = GUISaveState.getInstance();
        guiLayout.saveState();
        guiSaveState.setFrameBounds(getBounds());
        guiSaveState.setExtendedWindowState(getExtendedState());
        guiSaveState.save();
        System.exit(0);
    }
450548
def _save(self, stateName, path):
        """"""
        print('saving...')

        state = {'session': dict(self.opts),
                 'dialogs': self.dialogs.saveState()}

        self.sigSave.emit(state)
        self.saveThread.prepare(stateName, path, self.tmp_dir_session, state)
        self.saveThread.start()

        self.current_session = stateName

        r = self.opts['recent sessions']
        try:
            # is this session already exists: remove it
            r.pop(r.index(path))
        except ValueError:
            pass
        # add this session at the beginning
        r.insert(0, path)