コード例 #1
0
  /**
   * Tries to resolve the value entered in the link target field as a variable, if the value is a
   * relative path. Displays the resolved value if the entered value is a variable.
   */
  private void resolveVariable() {
    IPathVariableManager pathVariableManager =
        RemoteResourcesPlugin.getWorkspace().getPathVariableManager();
    IPath path = new Path(linkTarget);
    IPath resolvedPath = pathVariableManager.resolvePath(path);

    if (path.equals(resolvedPath)) {
      resolvedPathLabelText.setVisible(false);
      resolvedPathLabelData.setVisible(false);
    } else {
      resolvedPathLabelText.setVisible(true);
      resolvedPathLabelData.setVisible(true);
    }
    resolvedPathLabelData.setText(resolvedPath.toOSString());
  }