org.dadacoalition.yedit.YEditLog类的使用及代码示例

x33g5p2x  于2022-02-05 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(84)

本文整理了Java中org.dadacoalition.yedit.YEditLog类的一些代码示例,展示了YEditLog类的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YEditLog类的具体详情如下:
包路径:org.dadacoalition.yedit.YEditLog
类名称:YEditLog

YEditLog介绍

[英]Utility class for logging exceptions and for tracing plugin execution.
[中]用于记录异常和跟踪插件执行的实用程序类。

代码示例

代码示例来源:origin: oyse/yedit

private void checkIfOptionsComplete(String[] allKeys) {
  for (int i= 0; i < allKeys.length; i++) {
    if (fPreferenceStore.getString(allKeys[i]) == null) {
      YEditLog.logError("Preference option missing: " + allKeys[i] + " (" + this.getClass().getName() +')');  //$NON-NLS-1$//$NON-NLS-2$
    }
  }
}

代码示例来源:origin: oyse/yedit

public static void logException( Throwable exception ){
  logException( exception, "Unexpected exception: " );
}

代码示例来源:origin: oyse/yedit

public void start(BundleContext context) throws Exception {
  super.start(context);
  plugin = this;
  YEditLog.initializeTraceLogger();		
}

代码示例来源:origin: oyse/yedit

YEditLog.logError("Marking errors not supported for files outside of a project." );
  YEditLog.logger.info("editorInput is not a part of a project." );
  return;
  file.deleteMarkers(IMarker.PROBLEM, true, depth);
} catch (CoreException e) {
  YEditLog.logException(e);
  YEditLog.logger.warning("Failed to delete markers:\n" + e.toString() );
  YEditLog.logException(e);
  YEditLog.logger.warning("Failed to create marker for syntax error: \n" + e.toString() );

代码示例来源:origin: oyse/yedit

YEditLog.logError("Locating task tags are not supported for files outside of a project." );
  YEditLog.logger.info("editorInput is not a part of a project." );
  return;
  file.deleteMarkers(IMarker.TASK, true, depth);
} catch (CoreException e) {
  YEditLog.logException(e);
  YEditLog.logger.warning("Failed to delete task markers:\n" + e.toString() );
    YEditLog.logException(e);

代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor

@Override
public IStatus runInWorkspace(IProgressMonitor monitor) throws CoreException {
  try {
    return doRunInWorkspace(monitor);
  } catch (CoreException e) {
    return e.getStatus();
  } catch (OperationCanceledException e) {
    return Status.CANCEL_STATUS;
  } catch (Exception e) {
    // in case of an exception the Worker treats it with
    // an ERROR status in org.eclipse.core.internal.jobs.Worker.handleException(InternalJob, Throwable)
    // and shows a modal dialog by WorkbenchStatusDialogManagerImpl
    YEditLog.logException(e);
    return Status.CANCEL_STATUS;
  } finally {
    monitor.done();
  }
}

代码示例来源:origin: oyse/yedit

protected void addDocumentIdleListener(IDocumentIdleListener listener) {
  if (idleTimer != null) {
    idleTimer.addListener(listener);
  } else {
    YEditLog.logError( "Failed adding listener for idle document since listener is null" );
    YEditLog.logger.severe( "listener is null" );
  }
}

代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor

protected static void clearMarkers(IFile file) {
  int depth = IResource.DEPTH_INFINITE;
  try {
    file.deleteMarkers(IMarker.PROBLEM, true, depth);
  } catch (CoreException e) {
    YEditLog.logException(e);
    YEditLog.logger.warning("Failed to delete markers:\n" + e.toString());
  }
}

代码示例来源:origin: oyse/yedit

logError( "The traceLevel '" + traceLevelString + "' is not valid. Trace level set to SEVERE" );
  traceLevel = Level.SEVERE;
} else {

代码示例来源:origin: oyse/yedit

private String getTokenString(IDocument document){
  try {
    return document.get(scanner.getTokenOffset(), scanner.getTokenLength());
  } catch (BadLocationException e) {
    YEditLog.logException(e, "Finding todo tag failed" );
    return "";
  }
}

代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor

YEditLog.logError("Marking errors not supported for files outside of a project.");
YEditLog.logger.info("editorInput is not a part of a project.");
return;

代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor

public Set<SwaggerError> validate(JsonDocument document) {
  final ErrorProcessor processor = new ErrorProcessor(document.getYaml(), schema);
  final Set<SwaggerError> errors = new HashSet<>();
  JsonSchema jsonSchema = null;
  try {
    jsonSchema = factory.getJsonSchema(schema);
  } catch (ProcessingException e) {
    YEditLog.logException(e);
    return errors;
  }
  try {
    errors.addAll(processor.processReport(jsonSchema.validate(document.asJson(), true)));
  } catch (ProcessingException e) {
    errors.addAll(processor.processMessage(e.getProcessingMessage()));
  }
  return errors;
}

代码示例来源:origin: oyse/yedit

public TemplateStore getTemplateStore() {
  
  if (templateStore == null) {
    templateStore = new ContributionTemplateStore(getContextTypeRegistry(), getDefault().getPreferenceStore(), TEMPLATE_STORE_ID);
    try {
      templateStore.load();
    } catch (IOException e) {
      YEditLog.logException(e);
    }
  }
  return templateStore;	    
}

代码示例来源:origin: oyse/yedit

private TaskTag constructTodoTag(String tokenString, IDocument document) {
  
  int lineNumber = 1;
  try {
    lineNumber = document.getLineOfOffset(scanner.getTokenOffset()) + 1;
  } catch (BadLocationException e) {
    YEditLog.logException(e, "Failed to get the correct line number" );
  }
  
  TaskTagPreference ttp = getFoundTagType(tokenString);
  String message = getTodoTagMessage(tokenString, ttp.tag);
  return new TaskTag(ttp.tag, ttp.severity, lineNumber, message);
}

代码示例来源:origin: RepreZen/KaiZen-OpenAPI-Editor

static IMarker addMarker(SwaggerError error, IFile target, IDocument document) {
  IMarker marker = null;
  try {
    marker = target.createMarker(IMarker.PROBLEM);
    marker.setAttribute(IMarker.SEVERITY, error.getLevel());
    marker.setAttribute(IMarker.MESSAGE, error.getMessage());
    marker.setAttribute(IMarker.LINE_NUMBER, error.getLine());
  } catch (CoreException e) {
    YEditLog.logException(e);
    YEditLog.logger.warning("Failed to create marker for syntax error: \n" + e.toString());
  }
  return marker;
}

代码示例来源:origin: oyse/yedit

public void dispose() {
  try {
    colorManager.dispose();
    if (idleTimer != null) {
      idleTimer.dispose();
    }
    
    Activator.getDefault().getPreferenceStore().removePropertyChangeListener(propertyChangeListener);
    super.dispose();
  } catch (InterruptedException e) {
    YEditLog.logException(e);
  }
}

代码示例来源:origin: oyse/yedit

YEditLog.logException(e, "Failure during doubleclick action");

代码示例来源:origin: oyse/yedit

@Override
public IRegion getDamageRegion(ITypedRegion partition, DocumentEvent e, boolean documentPartitioningChanged){
  
  
  IRegion damagedRegion = null;
  try {
    IDocument doc = e.getDocument();
    IRegion damagedLine = doc.getLineInformationOfOffset(e.getOffset());
    
    // the damaged line is too long so calculate a smaller region to damage instead of the
    // whole line.
    if(damagedLine.getLength() > MAX_COMPLETE_LINE_DAMAGE ){
      damagedRegion = calculateRegionToDamage(e.getOffset(), doc);
    } else {
      damagedRegion = super.getDamageRegion(partition, e, documentPartitioningChanged);
    }
    
    
  } catch (BadLocationException ex) {
    YEditLog.logException(ex, "Failed to get the region for a document change.");
  }
  
  return damagedRegion;
}

代码示例来源:origin: oyse/yedit

YEditLog.logException(e, "Replacing special chars in unquoted scalars failed" );

相关文章