Package org.nasutekds.guitools.controlpanel.ui

Examples of org.nasutekds.guitools.controlpanel.ui.ProgressDialog$ProgressPanel


  public void runTask()
  {
    state = State.RUNNING;
    starting = false;
    lastException = null;
    final ProgressDialog dlg = getProgressDialog();
    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        String cmdLine = getStopCommandLineName();
        printEquivalentCommandLine(cmdLine, getCommandLineArguments(),
            INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_STOP_SERVER.get());
        dlg.setSummary(Message.raw(
            Utilities.applyFont(
            INFO_CTRL_PANEL_STOPPING_SERVER_SUMMARY.get().toString(),
            ColorAndFontConstants.defaultFont)));
      }
    });
    // To display new status
    getInfo().regenerateDescriptor();
    getInfo().stopPooling();
    try
    {
      ArrayList<String> arguments = getCommandLineArguments();

      String[] args = new String[arguments.size()];

      arguments.toArray(args);
      returnCode = executeCommandLine(getStopCommandLineName(), args);

      if (returnCode != 0)
      {
        state = State.FINISHED_WITH_ERROR;
      }
      else
      {
        SwingUtilities.invokeLater(new Runnable()
        {
          public void run()
          {
            getProgressDialog().getProgressBar().setIndeterminate(false);
            dlg.getProgressBar().setValue(30);
            dlg.appendProgressHtml(Utilities.applyFont(
                "<b>"+INFO_CTRL_PANEL_SERVER_STOPPED.get()+"</b><br><br>",
                ColorAndFontConstants.progressFont));
            String cmdLine = getStartCommandLineName();
            printEquivalentCommandLine(cmdLine, getStartCommandLineArguments(),
                INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_START_SERVER.get());

            dlg.setSummary(Message.raw(
                Utilities.applyFont(
                INFO_CTRL_PANEL_STARTING_SERVER_SUMMARY.get().toString(),
                ColorAndFontConstants.defaultFont)));
          }
        });
View Full Code Here


    args.addAll(getConnectionCommandLineArguments());
    args.add(getNoPropertiesFileArgument());
    args.add("--no-prompt");

    final ProgressDialog progressDialog = getProgressDialog();

    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        if (enable)
        {
          printEquivalentCommandLine(getCommandLinePath("dsconfig"),
              args, INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_ENABLE_BACKEND.get(
                  backendName));
          progressDialog.appendProgressHtml(Utilities.getProgressWithPoints(
              INFO_CTRL_PANEL_ENABLING_BACKEND.get(backendName),
              ColorAndFontConstants.progressFont));
        }
        else
        {
          printEquivalentCommandLine(getCommandLinePath("dsconfig"),
              args, INFO_CTRL_PANEL_EQUIVALENT_CMD_TO_DISABLE_BACKEND.get(
                  backendName));
          progressDialog.appendProgressHtml(Utilities.getProgressWithPoints(
              INFO_CTRL_PANEL_DISABLING_BACKEND.get(backendName),
              ColorAndFontConstants.progressFont));
        }
      }
    });

    ManagementContext mCtx = LDAPManagementContext.createFromContext(
        JNDIDirContextAdaptor.adapt(getInfo().getDirContext()));
    RootCfgClient root = mCtx.getRootConfiguration();
    LocalDBBackendCfgClient backend =
      (LocalDBBackendCfgClient)root.getBackend(backendName);

    if (backend.isEnabled() != enable)
    {
      backend.setEnabled(enable);
      backend.commit();
    }

    SwingUtilities.invokeLater(new Runnable()
    {
      public void run()
      {
        progressDialog.appendProgressHtml(Utilities.getProgressDone(
            ColorAndFontConstants.progressFont)+
        "<br><br>");
      }
    });
  }
View Full Code Here

TOP

Related Classes of org.nasutekds.guitools.controlpanel.ui.ProgressDialog$ProgressPanel

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.