APISonar


processing.app.Base.log

> processing > app > Base > log
processing APIs app APIs Base APIs log APIs

Example 1
public void saveLanguage(String language) {
    String[] cmdarray = new String[]{
      "defaults", "write",
      System.getProperty("user.home") + "/Library/Preferences/org.processing.app",
      "AppleLanguages", "-array", language
    };
    try {
      Runtime.getRuntime().exec(cmdarray);
    } catch (IOException e) {
      Base.log("Error saving platform language: " + e.getMessage());
    }
  }
Example 2
private void processControlSpace(final KeyEvent event) {
    if (event.getKeyCode() == KeyEvent.VK_SPACE && event.isControlDown()) {
      SwingWorker<Object, Object> worker = new SwingWorker<Object, Object>() {
        protected Object doInBackground() throws Exception {
          // Provide completions only if it's enabled
          if (JavaMode.codeCompletionsEnabled) {
            Base.log("[KeyEvent]" + KeyEvent.getKeyText(event.getKeyCode()) + "  |Prediction started");
            Base.log("Typing: " + fetchPhrase(event));
          }
          return null;
        }
      };
      worker.execute();
    }
  }
Example 3
public void classLoaded(ReferenceType theClass) {
        // check if our class is being loaded
        Base.log("Class Loaded: " + theClass.name());
        if (theClass.name().equals(className())) {
            this.theClass = theClass;
            attach();
        }
        for (ReferenceType ct : theClass.nestedTypes()) {
          Base.log("Nested " + ct.name());
        }
    }
Example 4
static public ToolContribution load(File folder) {
    try {
      return new ToolContribution(folder);
    } catch (IgnorableException ig) {
      Base.log(ig.getMessage());

    } catch (VerifyError ve) {  // incompatible
      // avoid the excessive error spew that happens here

    } catch (Throwable e) {  // unknown error
      e.printStackTrace();
    }
    return null;
  }
Example 5
File findCandidate(File folder) {
    File[] folders = listCandidates(folder);

    if (folders.length == 0) {
      return null;

    } else if (folders.length > 1) {
      Base.log("More than one " + toString() + " found inside " + folder.getAbsolutePath());
    }
    return folders[0];
  }
Example 6
static public ModeContribution load(Base base, File folder, String searchName) {
    try {
      return new ModeContribution(base, folder, searchName);
    } catch (IgnorableException ig) {
      Base.log(ig.getMessage());
    } catch (Exception e) {
      e.printStackTrace();
    }
    return null;
  }
Example 7
public int getPDECodeOffsetForSN(ASTGenerator astGen){
    if (Node instanceof SimpleName) {
      Element lineElement = astGen.getJavaSourceCodeElement(lineNumber);
      Base.log("Line element off " + lineElement.getStartOffset());
      OffsetMatcher ofm = new OffsetMatcher(astGen.getPDESourceCodeLine(lineNumber),
                                            astGen.getJavaSourceCodeLine(lineNumber));
      //log("");
      int pdeOffset = ofm.getPdeOffForJavaOff(Node.getStartPosition()
          - lineElement.getStartOffset(), Node.toString().length());
      return pdeOffset;
    }
    return -1;
  }
Example 8
protected void checkForMissingImports() {
    if (JavaMode.importSuggestEnabled) {
      for (Problem p : problemsList) {
        if(p.getIProblem().getID() == IProblem.UndefinedType) {
          String args[] = p.getIProblem().getArguments();
          if (args.length > 0) {
            String missingClass = args[0];
            Base.log("Will suggest for type:" + missingClass);
            //astGenerator.suggestImports(missingClass);
          }
        }
      }
    }
  }