@RequestMapping(method = RequestMethod.POST) public ModelAndView onSubmit(@ModelAttribute("command") About command, BindingResult result) { if (!StringUtils.hasText(command.getEmail())) { result.rejectValue("email", "email.required"); } if (command.getComments().length() > 32) { result.rejectValue("email", "email.length.exceeded"); } if (!StringUtils.hasText(command.getComments())) { result.rejectValue("comments", "comment.required"); } if (command.getComments().length() > 255) { result.rejectValue("comments", "comment.length.exceeded"); } if (result.hasErrors()) { return new ModelAndView("common/about", "command", command); } else { dao.insertComments(command); return new ModelAndView("common/aboutSuccess"); } }
private void jMenu1ActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jMenu1ActionPerformed // TODO add your handling code here: About ab = new About(); Dimension screenSize = this.getSize(); Dimension frameSize = ab.getSize(); ab.setLocation( (screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2); ab.setVisible(true); } // GEN-LAST:event_jMenu1ActionPerformed
/** Show about dialog */ private void showAbout() { String version = "unknown"; // $NON-NLS-1$ try { version = getPackageManager().getPackageInfo(Constants.PACKAGE, 0).versionName; } catch (NameNotFoundException e) { // sadness } About.showAbout(this, version); }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (D) Log.d(TAG, "onOptionsItemSelected"); super.onOptionsItemSelected(item); switch (item.getItemId()) { case R.id.startstop_menu: if (mService == null) startHDS(); else stopHDS(); return true; case R.id.mode_menu: if (mViewMode == HarleyDroidDashboardView.VIEW_GRAPHIC) mViewMode = HarleyDroidDashboardView.VIEW_TEXT; else mViewMode = HarleyDroidDashboardView.VIEW_GRAPHIC; mHarleyDroidDashboardView.changeView( mViewMode, getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT, mUnitMetric); mHarleyDroidDashboardView.drawAll(mHD); return true; case R.id.diag_menu: Intent diagnosticsActivity = new Intent(getBaseContext(), HarleyDroidDiagnostics.class); startActivity(diagnosticsActivity); return true; case R.id.preferences_menu: Intent settingsActivity = new Intent(getBaseContext(), HarleyDroidSettings.class); startActivity(settingsActivity); return true; case R.id.reset_menu: if (mHD != null) mHD.resetCounters(); return true; case R.id.about_menu: About.about(this); return true; default: return super.onOptionsItemSelected(item); } }
private void tabAboutActionPerformed( java.awt.event.ActionEvent evt) { // GEN-FIRST:event_tabAboutActionPerformed About about = new About(); about.setVisible(true); } // GEN-LAST:event_tabAboutActionPerformed
/** Initialize la barre d'outils en créant les bouttons */ private void init() { if (ProgletEngine.getInstance().getProgletCount() > 1) addTool( "Nouvelle activité", "org/javascool/widgets/icons/new.png", new Runnable() { @Override public void run() { JVSPanel.getInstance().closeProglet(); } }); addTool( "Nouveau fichier", "org/javascool/widgets/icons/new.png", new Runnable() { @Override public void run() { JVSPanel.getInstance().newFile(); } }); addTool( "Ouvrir un fichier", "org/javascool/widgets/icons/open.png", new Runnable() { @Override public void run() { JVSPanel.getInstance().openFile(); } }); addTool( "Sauver", "org/javascool/widgets/icons/save.png", new Runnable() { @Override public void run() { JVSPanel.getInstance().saveFile(); } }); { JPopupMenu menu = addTool("Sauver en ...", "org/javascool/widgets/icons/saveas.png"); JLabel l = new JLabel("Sauvegarde du fichier Java'sCool courant:"); l.setIcon(Macros.getIcon("org/javascool/widgets/icons/saveas.png")); menu.add(l); menu.add(" .. en javascool (.jvs)") .addActionListener( new ActionListener() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { JVSPanel.getInstance().saveAsFile(); } }); menu.add(" .. source forme de source java (.java)") .addActionListener( new ActionListener() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { new Thread( new Runnable() { public void run() { JVSPanel.getInstance().saveAsJavaFile(); } }) .start(); } }); menu.add(" .. sous forme exécutable (.jar)") .addActionListener( new ActionListener() { private static final long serialVersionUID = 1L; @Override public void actionPerformed(ActionEvent e) { new Thread( new Runnable() { public void run() { JVSPanel.getInstance().saveAsJarFile(); } }) .start(); } }); } compileButton = addTool( "Compiler", "org/javascool/widgets/icons/compile.png", new Runnable() { @Override public void run() { JVSPanel.getInstance().compileFile(); } }); addTool( "Executer", runButton = new StartStopButton() { private static final long serialVersionUID = 1L; @Override public void start() { JVSWidgetPanel.getInstance().focusOnProgletPanel(); ProgletEngine.getInstance().doRun(); } @Override public void stop() { ProgletEngine.getInstance().doStop(); } @Override public boolean isRunning() { return ProgletEngine.getInstance().isRunning(); } }); runButton.setVisible(false); /* this.demoButton = addTool("Demo", "org/javascool/widgets/icons/play.png", new Runnable() { @Override public void run() { JVSWidgetPanel.getInstance().focusOnProgletPanel(); ProgletEngine.getInstance().getProglet().doDemo(); } } ); demoButton.setVisible(false); */ /* Crée le menu de construction de proglets si pertinent if(ProgletsBuilder.canBuildProglets()) { pbutton = addRightTool("Proglet Builder", new Runnable() { @Override public void run() { DialogFrame.startFrame(); } } ); }*/ this.add(About.getAboutMessage(), 0); revalidate(); repaint(); }