public void executeTask(String sTaskClass) { m_appview.waitCursorBegin(); if (m_appuser.hasPermission(sTaskClass)) { try { ProcessAction myProcess = (ProcessAction) m_appview.getBean(sTaskClass); // execute the proces try { MessageInf m = myProcess.execute(); if (m != null) { // si devuelve un mensaje, lo muestro JMessageDialog.showMessage(JPrincipalApp.this, m); } } catch (BasicException eb) { // Si se produce un error lo muestro. JMessageDialog.showMessage(JPrincipalApp.this, new MessageInf(eb)); } } catch (BeanFactoryException e) { JMessageDialog.showMessage( JPrincipalApp.this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("Label.LoadError"), e)); } } else { // No hay permisos para ejecutar la accion... JMessageDialog.showMessage( JPrincipalApp.this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notpermissions"))); } m_appview.waitCursorEnd(); }
public void showTask(String sTaskClass) { m_appview.waitCursorBegin(); if (m_appuser.hasPermission(sTaskClass)) { JPanelView m_jMyView = (JPanelView) m_aCreatedViews.get(sTaskClass); // cierro la antigua if (m_jLastView == null || (m_jMyView != m_jLastView && m_jLastView.deactivate())) { // Construct the new view if (m_jMyView == null) { // Is the view prepared m_jMyView = m_aPreparedViews.get(sTaskClass); if (m_jMyView == null) { // The view is not prepared. Try to get as a Bean... try { m_jMyView = (JPanelView) m_appview.getBean(sTaskClass); } catch (BeanFactoryException e) { m_jMyView = new JPanelNull(m_appview, e); } } m_jPanelContainer.add(m_jMyView.getComponent(), sTaskClass); m_aCreatedViews.put(sTaskClass, m_jMyView); } // ejecuto la tarea try { m_jMyView.activate(); } catch (BasicException e) { JMessageDialog.showMessage( this, new MessageInf( MessageInf.SGN_WARNING, AppLocal.getIntString("message.notactive"), e)); } // se tiene que mostrar el panel m_jLastView = m_jMyView; showView(sTaskClass); // Y ahora que he cerrado la antigua me abro yo String sTitle = m_jMyView.getTitle(); m_jPanelTitle.setVisible(sTitle != null); m_jTitle.setText(sTitle); } } else { // No hay permisos para ejecutar la accion... JMessageDialog.showMessage( this, new MessageInf(MessageInf.SGN_WARNING, AppLocal.getIntString("message.notpermissions"))); } m_appview.waitCursorEnd(); }
private ScriptGroup(String key) { // taskGroup = new JTaskPaneGroup(); taskGroup = new JXTaskPane(); taskGroup.setFocusable(false); taskGroup.setRequestFocusEnabled(false); taskGroup.setTitle(AppLocal.getIntString(key)); taskGroup.setVisible(false); // Only groups with sons are visible. }
public void actionPerformed(ActionEvent evt) { String sNewPassword = Hashcypher.changePassword(JPrincipalApp.this, m_appuser.getPassword()); if (sNewPassword != null) { try { m_dlSystem.execChangePassword(new Object[] {sNewPassword, m_appuser.getId()}); m_appuser.setPassword(sNewPassword); } catch (BasicException e) { JMessageDialog.showMessage( JPrincipalApp.this, new MessageInf( MessageInf.SGN_WARNING, AppLocal.getIntString("message.cannotchangepassword"))); } } }
public ChangePasswordAction(String icon, String keytext) { putValue(Action.SMALL_ICON, new ImageIcon(JPrincipalApp.class.getResource(icon))); putValue(Action.NAME, AppLocal.getIntString(keytext)); putValue(AppUserView.ACTION_TASKNAME, keytext); }