Examples of Desktop


Examples of java.awt.Desktop

   *
   * @param url absolute url to open in the browser
   */
  protected void browse(String url) {
    if (Desktop.isDesktopSupported()) {
      Desktop desktop = Desktop.getDesktop();
      if (desktop.isSupported(Action.BROWSE)) {
        try {
          desktop.browse(URI.create(url));
          return;
        } catch (IOException e) {
        }
      }
    }
View Full Code Here

Examples of net.sf.mzmine.desktop.Desktop

  public void actionPerformed(ActionEvent actionEvent) {

    Object src = actionEvent.getSource();

    Desktop desktop = MZmineCore.getDesktop();

    if (src == buttonAddParameter) {
      if (fieldName.getText().length() == 0) {
        desktop.displayErrorMessage("Give a name for the parameter first.");
        return;
      }
      String paramName = fieldName.getText();

      UserParameter parameter = null;

      if (radiobuttonNumerical.isSelected()) {

        parameter = new DoubleParameter(paramName, null);
      }

      if (radiobuttonFreeText.isSelected()) {
        parameter = new StringParameter(paramName, null);
      }

      if (radiobuttonCategorical.isSelected()) {
        String[] possibleValues = new String[categories.size()];
        if (possibleValues.length == 0) {
          desktop.displayErrorMessage("Give at least a single parameter value.");
          return;
        }
        for (int valueIndex = 0; valueIndex < categories.size(); valueIndex++)
          possibleValues[valueIndex] = (String) categories
              .get(valueIndex);
        parameter = new ComboParameter<String>(paramName, null,
            possibleValues);
      }

      mainDialog.addParameter(parameter);

      dispose();
    }

    if (src == buttonCancel) {
      dispose();
    }

    if ((src == radiobuttonNumerical) || (src == radiobuttonCategorical)
        || (src == radiobuttonFreeText)) {
      if (radiobuttonCategorical.isSelected()) {
        switchCategoricalFields(true);
      } else {
        switchCategoricalFields(false);
      }
    }

    if (src == buttonAddCategory) {
      String inputValue = JOptionPane
          .showInputDialog("Please input a new value");
      if ((inputValue == null) || (inputValue.trim().length() == 0))
        return;
      if (((DefaultListModel) listCategories.getModel())
          .contains(inputValue)) {
        desktop.displayErrorMessage("Value already exists.");
        return;
      }
      ((DefaultListModel) listCategories.getModel())
          .addElement(inputValue);
    }

    if (src == buttonRemoveCategory) {

      int[] selectedIndices = listCategories.getSelectedIndices();
      if ((selectedIndices == null) || (selectedIndices.length == 0)) {
        desktop.displayErrorMessage("Select at least one value first.");
        return;
      }

      for (int selectedIndex : selectedIndices) {
        ((DefaultListModel) listCategories.getModel())
View Full Code Here

Examples of org.platformlayer.service.desktop.model.Desktop

  public void doOperation() throws OpsException, IOException {
  }

  @Override
  protected void addChildren() throws OpsException {
    Desktop model = OpsContext.get().getInstance(Desktop.class);

    InstanceBuilder instance = InstanceBuilder.build(model.dnsName, this, model.getTags());
    instance.publicPorts.add(22);

    instance.hostPolicy.allowRunInContainer = true;
    instance.minimumMemoryMb = 4096;

    addChild(instance);

    {
      RecipeOperatingSystem os = injected(RecipeOperatingSystem.class);
      os.operatingSystem = new OperatingSystemRecipe();
      os.operatingSystem.setDistribution("debian");
      os.operatingSystem.setVersion("wheezy");
      instance.addChild(os);
    }

    // We use curl for backups
    instance.addChild(PackageDependency.build("curl"));

    {
      PublicEndpoint endpoint = injected(PublicEndpoint.class);
      // endpoint.network = null;
      endpoint.publicPort = 22;
      endpoint.backendPort = 22;
      endpoint.dnsName = model.dnsName;

      endpoint.tagItem = model.getKey();
      endpoint.parentItem = model.getKey();

      instance.addChild(endpoint);
    }

    // {
View Full Code Here

Examples of org.thechiselgroup.choosel.dnd.client.windows.Desktop

        WorkspaceManager workspaceManager = mock(WorkspaceManager.class);

        when(workspaceManager.getWorkspace()).thenReturn(workspace);

        Desktop desktop = mock(Desktop.class);
        WindowContentProducer viewFactory = mock(WindowContentProducer.class);
        WorkspacePersistenceServiceAsync persistenceService = new TestWorkspacePersistenceServiceAsync();
        ResourceSetFactory resourceSetFactory = mock(ResourceSetFactory.class);
        WorkspaceSharingServiceAsync sharingService = mock(WorkspaceSharingServiceAsync.class);
        PersistableRestorationService restorationService = mock(PersistableRestorationService.class);
View Full Code Here

Examples of org.zkoss.zk.ui.Desktop

   *
   * @since 3.6.1
   * @return the encoded src where to find the flash source
   */
  public String getEncodedSrc() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_src) : "";
  }
View Full Code Here

Examples of org.zkoss.zk.ui.Desktop

   *
   * @since 3.6.1
   * @return the encoded js path where to find the scripts
   */
  public String getEncodedJsPath() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_jspath) : "";
  }
View Full Code Here

Examples of org.zkoss.zk.ui.Desktop

    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_jspath) : "";
  }

  public String getEncodedJs() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_js) : "";
  }
View Full Code Here

Examples of org.zkoss.zk.ui.Desktop

    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().encodeURL(_js) : "";
  }

  public boolean isExplorer() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().isExplorer() : true;
  }
View Full Code Here

Examples of org.zkoss.zk.ui.Desktop

    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().isExplorer() : true;
  }

  public boolean isFirefox() {
    final Desktop dt = getDesktop();
    return dt != null ? dt.getExecution().isGecko() : false;
  }
View Full Code Here

Examples of org.zkoss.zk.ui.Desktop

  /** Returns the encoded URL for the dynamic generated content, or empty
   * the component doesn't belong to any desktop.
   */
  private static String getDynamicMediaURI(AbstractComponent comp,
  int version, String name, String format) {
    final Desktop desktop = comp.getDesktop();
    if (desktop == null) return ""; //no avail at client

    final StringBuffer sb = new StringBuffer(64).append('/');
    Strings.encode(sb, version);
    if (name != null || format != null) {
      sb.append('/');
      boolean bExtRequired = true;
      if (name != null && name.length() != 0) {
        sb.append(name.replace('\\', '/'));
        bExtRequired = name.lastIndexOf('.') < 0;
      } else {
        sb.append(comp.getId());
      }
      if (bExtRequired && format != null)
        sb.append('.').append(format);
    }
    return desktop.getDynamicMediaURI(comp, sb.toString()); //already encoded
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.