Package ch.mtSystems.jnc.control

Examples of ch.mtSystems.jnc.control.AppController


  public void widgetSelected(SelectionEvent e)
  {
    if(e.getSource() == JNC.getNextButton())
    {
      AppController ap = AppController.getAppController();

      if(ap.getCurrentProject() != null && rbNewProject.getSelection() == true)
      {
        String title = "discard current project?";
        String msg = "You have currently another project that will be discarded.\nContinue?";

        MessageBox messageBox = new MessageBox(JNC.getContentComposite().getShell(),
            SWT.ICON_QUESTION|SWT.YES|SWT.NO);
        messageBox.setText(title);
        messageBox.setMessage(msg);
        if(messageBox.open() != SWT.YES) return;
      }

      if(rbNewProject.getSelection())
      {
        ap.setCurrentProject(new JNCProject());
      } else if(rbOpenProject.getSelection())
      {
        try
        {
          File f = new File(tOpenProject.getText());
          ap.setCurrentProject(JNCProject.open(f));
        } catch(Exception ex)
        {
          ex.printStackTrace();

          String title = "error on open";
          String msg = "An error occured while trying to open:\n" + ex.getMessage();

          MessageBox mb = new MessageBox(JNC.getContentComposite().getShell(),
              SWT.ICON_ERROR|SWT.OK);
          mb.setText(title);
          mb.setMessage(msg);
          mb.open();

          return;
        }
      }

      ap.loadPage(AppController.PAGE_SOURCE);
    } else if(e.getSource() == JNC.getPreviousButton())
    {
      AppController.getAppController().loadPage(AppController.PAGE_INTRODUCTION);
    } else if(e.getSource() == bOpenProject)
    {
View Full Code Here

TOP

Related Classes of ch.mtSystems.jnc.control.AppController

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.