mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
cleanup
This commit is contained in:
@@ -37,7 +37,7 @@ public interface EditorSettings {
|
||||
void setAdditionalLinesCount(int additionalLinesCount);
|
||||
|
||||
int getAdditionalColumnsCount();
|
||||
void setAdditionalColumnsCount(int additinalColumnsCount);
|
||||
void setAdditionalColumnsCount(int additionalColumnsCount);
|
||||
|
||||
boolean isLineMarkerAreaShown();
|
||||
void setLineMarkerAreaShown(boolean lineMarkerAreaShown);
|
||||
|
||||
@@ -185,9 +185,9 @@ public class SettingsImpl implements EditorSettings {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setAdditionalColumnsCount(int additinalColumnsCount) {
|
||||
if (myAdditionalColumnsCount == additinalColumnsCount) return;
|
||||
myAdditionalColumnsCount = additinalColumnsCount;
|
||||
public void setAdditionalColumnsCount(int additionalColumnsCount) {
|
||||
if (myAdditionalColumnsCount == additionalColumnsCount) return;
|
||||
myAdditionalColumnsCount = additionalColumnsCount;
|
||||
fireEditorRefresh();
|
||||
}
|
||||
|
||||
|
||||
@@ -375,7 +375,7 @@ public abstract class AbstractVcs<ComList extends CommittedChangeList> extends S
|
||||
* from revision numbers.
|
||||
*
|
||||
* @param revisionNumberString the string to be parsed
|
||||
* @param path the path for which revsion number is queried
|
||||
* @param path the path for which revision number is queried
|
||||
* @return the parsed revision number
|
||||
*/
|
||||
@Nullable
|
||||
@@ -589,8 +589,7 @@ public abstract class AbstractVcs<ComList extends CommittedChangeList> extends S
|
||||
}
|
||||
}
|
||||
};
|
||||
final boolean succeded = VcsSynchronousProgressWrapper.wrap(runnable, getProject(), "Load revision contents");
|
||||
return succeded ? list[0] : null;
|
||||
return VcsSynchronousProgressWrapper.wrap(runnable, getProject(), "Load revision contents") ? list[0] : null;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -15,7 +15,10 @@
|
||||
*/
|
||||
package com.intellij.openapi.vcs.actions;
|
||||
|
||||
import com.intellij.openapi.actionSystem.*;
|
||||
import com.intellij.openapi.actionSystem.ActionGroup;
|
||||
import com.intellij.openapi.actionSystem.AnAction;
|
||||
import com.intellij.openapi.actionSystem.AnActionEvent;
|
||||
import com.intellij.openapi.actionSystem.Separator;
|
||||
import com.intellij.openapi.editor.ex.EditorGutterComponentEx;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -27,7 +30,7 @@ import java.util.List;
|
||||
* @author Konstantin Bulenkov
|
||||
*/
|
||||
public class AnnotateActionGroup extends ActionGroup {
|
||||
private AnAction[] myActions;
|
||||
private final AnAction[] myActions;
|
||||
|
||||
public AnnotateActionGroup(List<AnnotationFieldGutter> gutters, EditorGutterComponentEx gutterComponent) {
|
||||
super("View", true);
|
||||
|
||||
@@ -63,6 +63,7 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.vcs.actions.AnnotateToggleAction");
|
||||
protected static final Key<Collection<ActiveAnnotationGutter>> KEY_IN_EDITOR = Key.create("Annotations");
|
||||
|
||||
@Override
|
||||
public void update(AnActionEvent e) {
|
||||
super.update(e);
|
||||
final boolean enabled = isEnabled(VcsContextFactory.SERVICE.getInstance().createContextOn(e));
|
||||
@@ -71,8 +72,9 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
|
||||
private static boolean isEnabled(final VcsContext context) {
|
||||
VirtualFile[] selectedFiles = context.getSelectedFiles();
|
||||
if (selectedFiles == null) return false;
|
||||
if (selectedFiles.length != 1) return false;
|
||||
if (selectedFiles.length != 1) {
|
||||
return false;
|
||||
}
|
||||
VirtualFile file = selectedFiles[0];
|
||||
if (file.isDirectory()) return false;
|
||||
Project project = context.getProject();
|
||||
@@ -98,6 +100,7 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
return !selectedFile.getFileType().isBinary();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSelected(AnActionEvent e) {
|
||||
VcsContext context = VcsContextFactory.SERVICE.getInstance().createContextOn(e);
|
||||
Editor editor = context.getEditor();
|
||||
@@ -124,6 +127,7 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
return annotations != null && !annotations.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSelected(AnActionEvent e, boolean selected) {
|
||||
final VcsContext context = VcsContextFactory.SERVICE.getInstance().createContextOn(e);
|
||||
Editor editor = context.getEditor();
|
||||
@@ -153,7 +157,9 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
|
||||
private static void doAnnotate(final Editor editor, final Project project) {
|
||||
final VirtualFile file = FileDocumentManager.getInstance().getFile(editor.getDocument());
|
||||
if (project == null) return;
|
||||
if (project == null || file == null) {
|
||||
return;
|
||||
}
|
||||
final ProjectLevelVcsManager plVcsManager = ProjectLevelVcsManager.getInstance(project);
|
||||
final AbstractVcs vcs = plVcsManager.getVcsFor(file);
|
||||
|
||||
@@ -172,6 +178,7 @@ public class AnnotateToggleAction extends ToggleAction implements DumbAware, Ann
|
||||
VcsBundle.message("retrieving.annotations"),
|
||||
true,
|
||||
BackgroundFromStartOption.getInstance()) {
|
||||
@Override
|
||||
public void run(final @NotNull ProgressIndicator indicator) {
|
||||
try {
|
||||
fileAnnotationRef.set(annotationProvider.annotate(file));
|
||||
|
||||
Reference in New Issue
Block a user