本文整理汇总了Java中org.eclipse.che.ide.util.loging.Log类的典型用法代码示例。如果您正苦于以下问题:Java Log类的具体用法?Java Log怎么用?Java Log使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Log类属于org.eclipse.che.ide.util.loging包,在下文中一共展示了Log类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: paste
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
protected void paste(Path destination) {
if (resources == null || resources.length == 0) {
Log.debug(getClass(), "Resources to process was not found");
return;
}
final Resource[] resourcesToProcess = copyOf(resources, resources.length);
final Path lastCopiedResource =
destination.append(resourcesToProcess[resourcesToProcess.length - 1].getName());
pasteSuccessively(promises.resolve(null), resourcesToProcess, 0, destination)
.then(
ignored -> {
eventBus.fireEvent(new RevealResourceEvent(lastCopiedResource));
});
}
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:CopyPasteManager.java
示例2: HelloWorldViewPresenter
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Inject
public HelloWorldViewPresenter(final HelloWorldView helloWorldView) {
this.helloWorldView = helloWorldView;
ScriptInjector.fromUrl(GWT.getModuleBaseURL() + Constants.JAVASCRIPT_FILE_ID)
.setWindow(ScriptInjector.TOP_WINDOW)
.setCallback(
new Callback<Void, Exception>() {
@Override
public void onSuccess(final Void result) {
Log.info(HelloWorldViewPresenter.class, Constants.JAVASCRIPT_FILE_ID + " loaded.");
sayHello("Hello from Java Script!");
}
@Override
public void onFailure(final Exception e) {
Log.error(
HelloWorldViewPresenter.class,
"Unable to load " + Constants.JAVASCRIPT_FILE_ID,
e);
}
})
.inject();
}
开发者ID:eclipse,项目名称:che-archetypes,代码行数:25,代码来源:HelloWorldViewPresenter.java
示例3: addPremiumSupportHelpAction
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
private void addPremiumSupportHelpAction() {
// userVoice init
ScriptInjector.fromUrl(resources.userVoice().getSafeUri().asString())
.setWindow(ScriptInjector.TOP_WINDOW)
.setCallback(
new Callback<Void, Exception>() {
@Override
public void onSuccess(Void aVoid) {
// add action
actionManager.registerAction(
localizationConstant.createSupportTicketAction(), createSupportTicketAction);
helpGroup.addSeparator();
helpGroup.add(createSupportTicketAction);
}
@Override
public void onFailure(Exception e) {
Log.error(getClass(), "Unable to inject UserVoice", e);
}
})
.inject();
}
开发者ID:codenvy,项目名称:codenvy,代码行数:24,代码来源:HelpExtension.java
示例4: doAfterKeycloakInitAndUpdate
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
private <R> Promise<R> doAfterKeycloakInitAndUpdate(Sender<R> sender) {
return keycloakProvider
.getUpdatedToken(5)
.thenPromise(
new Function<String, Promise<R>>() {
@Override
public Promise<R> apply(String keycloakToken) {
addAuthorizationHeader(keycloakToken);
try {
return sender.doSend();
} catch (Throwable t) {
Log.error(getClass(), t);
throw t;
}
}
});
}
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:KeycloakAsyncRequest.java
示例5: actionPerformed
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
List<EditorPartPresenter> dirtyEditors = editorAgent.getDirtyEditors();
if (dirtyEditors.isEmpty()) {
performAction();
return;
}
AsyncCallback<Void> savingOperationCallback =
new AsyncCallback<Void>() {
@Override
public void onFailure(Throwable caught) {
Log.error(getClass(), caught);
}
@Override
public void onSuccess(Void result) {
performAction();
}
};
dialogFactory
.createConfirmDialog(
locale.unsavedDataDialogTitle(),
locale.unsavedDataDialogPromptSaveChanges(),
() -> editorAgent.saveAll(savingOperationCallback),
null)
.show();
}
开发者ID:eclipse,项目名称:che,代码行数:30,代码来源:RenameRefactoringAction.java
示例6: onValueChanged
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public void onValueChanged(Variable variable, long threadId, int frameIndex) {
if (view.getSelectedThreadId() == threadId && view.getSelectedFrameIndex() == frameIndex) {
Debugger debugger = debuggerManager.getActiveDebugger();
if (debugger != null && debugger.isSuspended()) {
Promise<? extends SimpleValue> promise = debugger.getValue(variable, threadId, frameIndex);
promise
.then(
value -> {
MutableVariable updatedVariable =
variable instanceof MutableVariable
? ((MutableVariable) variable)
: new MutableVariableImpl(variable);
updatedVariable.setValue(value);
view.updateVariable(updatedVariable);
})
.catchError(
error -> {
Log.error(DebuggerPresenter.class, error.getCause());
});
}
}
}
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:DebuggerPresenter.java
示例7: selectKeyMode
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
private void selectKeyMode(Keymap keymap) {
resetKeyModes();
Keymap usedKeymap = keymap;
if (usedKeymap == null) {
usedKeymap = KeyMode.DEFAULT;
}
if (KeyMode.DEFAULT.equals(usedKeymap)) {
// nothing to do
} else if (EMACS.equals(usedKeymap)) {
this.editorOverlay.getTextView().addKeyMode(keyModeInstances.getInstance(EMACS));
} else if (VI.equals(usedKeymap)) {
this.editorOverlay.getTextView().addKeyMode(keyModeInstances.getInstance(VI));
} else {
usedKeymap = KeyMode.DEFAULT;
Log.error(
OrionEditorWidget.class,
"Unknown keymap type: " + keymap + " - changing to default one.");
}
this.keymap = usedKeymap;
}
开发者ID:eclipse,项目名称:che,代码行数:21,代码来源:OrionEditorWidget.java
示例8: addAnnotationItem
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
/**
* Add an inline annotation.
*
* @param annotationModel the annotation model
* @param annotation the annotation to add
* @param decorations the available decorations
*/
private void addAnnotationItem(
AnnotationModel annotationModel, Annotation annotation, Map<String, String> decorations) {
if (this.hasTextMarkers != null) {
final String className = decorations.get(annotation.getType());
if (className == null) {
return;
}
final Position position = annotationModel.getPosition(annotation);
if (position == null) {
Log.warn(InlineAnnotationRenderer.class, "Can't add annotation with no position");
return;
}
final TextPosition from = this.document.getPositionFromIndex(position.getOffset());
final TextPosition to =
this.document.getPositionFromIndex(position.getOffset() + position.getLength());
final MarkerRegistration registration =
this.hasTextMarkers.addMarker(new TextRange(from, to), className);
if (registration != null) {
this.markers.put(annotation, registration);
}
}
}
开发者ID:eclipse,项目名称:che,代码行数:33,代码来源:InlineAnnotationRenderer.java
示例9: addAnnotationItem
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
private void addAnnotationItem(
final AnnotationModel model,
final Annotation annotation,
final Map<String, String> decorations) {
final Position position = model.getPosition(annotation);
if (position == null) {
Log.warn(MinimapAnnotationRenderer.class, "No position for annotation " + annotation);
return;
}
// final TextPosition textPosition =
// this.document.getPositionFromIndex(position.getOffset());
// final int line = textPosition.getLine();
final String style = decorations.get(annotation.getType());
this.minimap.addMark(position.getOffset(), style, annotation.getLayer(), annotation.getText());
}
开发者ID:eclipse,项目名称:che,代码行数:17,代码来源:MinimapAnnotationRenderer.java
示例10: newKeymap
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
/**
* Creates a new keymap instance.
*
* @param key the key (must not already exist)
* @param displayString the name displayed to a user
* @return a new keymap instance
*/
public static Keymap newKeymap(final String key, final String displayString) {
if (key == null) {
throw new IllegalArgumentException("Keymap key can't be null");
}
if (displayString == null) {
throw new IllegalArgumentException("Keymap display string can't be null");
}
if (fromKey(key) != null) {
throw new RuntimeException("Keymap with key " + key + " already exists");
}
Log.debug(Keymap.class, "Creation of new keymap " + key);
Keymap keymap = new Keymap(key, displayString);
instances.put(key, keymap);
return keymap;
}
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:Keymap.java
示例11: identifyType
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public List<String> identifyType(final VirtualFile file) {
Log.debug(MultipleMethodFileIdentifier.class, "Try identification by file name.");
final List<String> firstTry = this.fileNameFileTypeIdentifier.identifyType(file);
if (firstTry != null && !firstTry.isEmpty()) {
return firstTry;
}
Log.debug(MultipleMethodFileIdentifier.class, "Try identification by file name suffix.");
final List<String> secondTry = this.extensionFileTypeIdentifier.identifyType(file);
if (secondTry != null && !secondTry.isEmpty()) {
return secondTry;
}
// try harder
Log.debug(MultipleMethodFileIdentifier.class, "Try identification by looking at the content.");
final List<String> thirdTry = this.firstLineFileTypeIdentifier.identifyType(file);
if (thirdTry != null && !thirdTry.isEmpty()) {
return thirdTry;
}
// other means may be added later
Log.debug(MultipleMethodFileIdentifier.class, "No identification method gave an answer.");
return null;
}
开发者ID:eclipse,项目名称:che,代码行数:23,代码来源:MultipleMethodFileIdentifier.java
示例12: identifyType
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public List<String> identifyType(final VirtualFile file) {
final String filename = file.getName();
if (filename != null) {
final int dotPos = filename.lastIndexOf('.');
if (dotPos
< 1) { // either -1 (not found) or 0 (first position, for example .project or .che etc.
Log.debug(ExtensionFileTypeIdentifier.class, "File name has no suffix ");
return null;
}
final String suffix = filename.substring(dotPos + 1);
Log.debug(ExtensionFileTypeIdentifier.class, "Looking for a type for suffix " + suffix);
List<String> result = mappings.get(suffix);
Log.debug(ExtensionFileTypeIdentifier.class, "Found mime-types: " + printList(result));
return result;
}
return null;
}
开发者ID:eclipse,项目名称:che,代码行数:19,代码来源:ExtensionFileTypeIdentifier.java
示例13: identifyType
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public List<String> identifyType(final VirtualFile file) {
// TODO: file's content retrieved asynchronously
final String content = "" /*file.getContent()*/;
if (isXml(content)) {
Log.debug(FirstLineFileTypeIdentifier.class, "Identified file as XML.");
return Collections.singletonList("application/xml");
}
final String shebangLoader = getShebang(content);
if (shebangLoader != null) {
final int lastSlash = shebangLoader.lastIndexOf('/');
// need to consider \ as path separator for a feature that exists mostly on unixes ?
final String basename = shebangLoader.substring(lastSlash + 1);
final String shebangResult = matchShebang(basename);
if (shebangResult != null) {
return Collections.singletonList(shebangResult);
}
}
return null;
}
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:FirstLineFileTypeIdentifier.java
示例14: detectTests
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
private void detectTests(TextEditor editor) {
this.currentEditor = editor;
TestDetectionContext context = dtoFactory.createDto(TestDetectionContext.class);
context.setFilePath(currentEditor.getEditorInput().getFile().getLocation().toString());
context.setOffset(currentEditor.getCursorOffset());
Resource resource = appContext.getResource();
Project project =
(resource == null || resource.getProject() == null)
? appContext.getRootProject()
: resource.getProject();
context.setProjectPath(project.getPath());
client
.detectTests(context)
.onSuccess(
testDetectionResult -> {
isEnable = testDetectionResult.isTestFile();
testPosition = testDetectionResult.getTestPosition();
})
.onFailure(
jsonRpcError -> {
Log.error(getClass(), jsonRpcError);
isEnable = false;
notificationManager.notify("Can't detect test methods");
});
}
开发者ID:eclipse,项目名称:che,代码行数:26,代码来源:TestDetector.java
示例15: addAction
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
public final void addAction(Action action, Constraints constraint, ActionManager actionManager) {
if (action == this) {
throw new IllegalArgumentException("Cannot add a group to itself");
}
// Check that action isn't already registered
if (!(action instanceof Separator)) {
for (Action actionInList : actionList) {
if (action.equals(actionInList)) {
Log.error(getClass(), "Can not add an action twice: " + action);
return;
}
}
}
actionList.add(action);
constraintsList.add(constraint);
needSorting = true;
}
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:DefaultActionGroup.java
示例16: open
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public void open() {
final int delay = propertyManager.getConnectionDelay(url);
if (isClosed() || isClosing()) {
if (delay == 0) {
webSocketJsoWrapper = WebSocketJsoWrapper.connect(url, endpoint);
} else {
new Timer() {
@Override
public void run() {
webSocketJsoWrapper = WebSocketJsoWrapper.connect(url, endpoint);
}
}.schedule(delay);
}
} else {
Log.warn(getClass(), "Opening already opened or connecting web socket.");
}
}
开发者ID:eclipse,项目名称:che,代码行数:20,代码来源:DelayableWebSocketConnection.java
示例17: visitTestingMessage
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public void visitTestingMessage(ClientTestingMessage message) {
if (TestingMessageNames.TESTING_STARTED.equals(message.getName())) {
if (processor != null) {
processor.onStartTesting();
}
return;
}
if (TestingMessageNames.FINISH_TESTING.equals(message.getName())) {
if (processor != null) {
processor.onFinishTesting();
}
return;
}
Log.error(getClass(), "Unexpected test message: " + message.getName());
}
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:TestingHandler.java
示例18: actionPerformed
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
@Override
public void actionPerformed(ActionEvent event) {
if (event.getParameters() == null) {
Log.error(getClass(), localizationConstant.runCommandEmptyParamsMessage());
return;
}
final String name = event.getParameters().get(NAME_PARAM_ID);
if (name == null) {
Log.error(getClass(), localizationConstant.runCommandEmptyNameMessage());
return;
}
wsAgentServerUtil
.getWsAgentServerMachine()
.ifPresent(
m ->
commandManager
.getCommand(name)
.ifPresent(command -> commandExecutor.executeCommand(command, m.getName())));
}
开发者ID:eclipse,项目名称:che,代码行数:22,代码来源:RunCommandAction.java
示例19: parseActionParameters
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
protected static Map<String, String> parseActionParameters(String actionParam) {
Log.info(StartUpActionsParser.class, " parametersMap " + actionParam);
final String[] parametersQuery = actionParam.split(";");
Map<String, String> params = new HashMap<>(parametersQuery.length);
for (int i = 0; i < parametersQuery.length; i++) {
final String parameterString = parametersQuery[i];
final String[] param = parameterString.split("=");
final String paramName = param[0];
if (param.length > 1) {
final String paramValue = param[1];
params.put(paramName, paramValue);
} else {
params.put(paramName, null);
}
}
return params;
}
开发者ID:eclipse,项目名称:che,代码行数:18,代码来源:StartUpActionsParser.java
示例20: restoreState
import org.eclipse.che.ide.util.loging.Log; //导入依赖的package包/类
private Promise<Void> restoreState(JsonObject settings) {
try {
if (settings.hasKey(WORKSPACE)) {
JsonObject workspace = settings.getObject(WORKSPACE);
Promise<Void> sequentialRestore = promises.resolve(null);
for (String key : workspace.keys()) {
Optional<StateComponent> stateComponent =
stateComponentRegistry.get().getComponentById(key);
if (stateComponent.isPresent()) {
StateComponent component = stateComponent.get();
Log.debug(getClass(), "Restore state for the component ID: " + component.getId());
sequentialRestore =
sequentialRestore.thenPromise(
ignored -> component.loadState(workspace.getObject(key)));
}
}
return sequentialRestore;
}
} catch (JsonException e) {
Log.error(getClass(), e);
}
return promises.resolve(null);
}
开发者ID:eclipse,项目名称:che,代码行数:24,代码来源:AppStateManager.java
注:本文中的org.eclipse.che.ide.util.loging.Log类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论