From b002c476e48fc2cf9ab3b424a933af8ab540d4dc Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Mon, 13 Aug 2018 19:13:09 +0200 Subject: [PATCH] override, fix public accessibility --- .../src/com/intellij/history/Label.java | 17 ++----------- .../intellij/history/LocalHistoryAction.java | 17 ++----------- .../com/intellij/history/core/ChangeList.java | 21 ++++------------ .../history/core/changes/MoveChange.java | 17 ++----------- .../history/core/changes/PutLabelChange.java | 18 +++----------- .../history/core/revisions/Difference.java | 19 ++++----------- .../history/core/tree/DirectoryEntry.java | 17 ++----------- .../history/integration/IdeaGateway.java | 17 ++----------- .../integration/LocalHistoryActionImpl.java | 17 ++----------- .../revertion/SelectionReverter.java | 18 +++----------- .../revertion/UndoChangeRevertingVisitor.java | 17 ++----------- .../ui/actions/LocalHistoryGroup.java | 17 ++----------- .../models/EntireFileHistoryDialogModel.java | 17 ++----------- .../integration/ui/views/HistoryDialog.java | 24 +++++++------------ .../ui/views/RecentChangeDialog.java | 18 ++------------ .../ui/views/RecentChangesPopup.java | 17 ++----------- .../integration/ui/views/RevisionsList.java | 23 ++++++------------ .../history/utils/RunnableAdapter.java | 17 ++----------- .../openapi/command/impl/ChangeRange.java | 17 ++----------- .../command/impl/DocumentUndoProvider.java | 2 +- 20 files changed, 58 insertions(+), 289 deletions(-) diff --git a/platform/lvcs-api/src/com/intellij/history/Label.java b/platform/lvcs-api/src/com/intellij/history/Label.java index 20bfcf9f4f72..d0f683ea7b00 100644 --- a/platform/lvcs-api/src/com/intellij/history/Label.java +++ b/platform/lvcs-api/src/com/intellij/history/Label.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history; @@ -27,6 +13,7 @@ public interface Label { public void revert(@NotNull Project project, @NotNull VirtualFile file) { } + @Override public ByteContent getByteContent(String path) { return null; } diff --git a/platform/lvcs-api/src/com/intellij/history/LocalHistoryAction.java b/platform/lvcs-api/src/com/intellij/history/LocalHistoryAction.java index 080c5e42577e..e177210b9815 100644 --- a/platform/lvcs-api/src/com/intellij/history/LocalHistoryAction.java +++ b/platform/lvcs-api/src/com/intellij/history/LocalHistoryAction.java @@ -1,23 +1,10 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history; public interface LocalHistoryAction { LocalHistoryAction NULL = new LocalHistoryAction() { + @Override public void finish() { } }; diff --git a/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java b/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java index 0dddc0477eb7..4fc1d160851e 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/ChangeList.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.core; @@ -22,7 +8,6 @@ import com.intellij.history.core.changes.ChangeVisitor; import com.intellij.history.utils.LocalHistoryLog; import com.intellij.openapi.application.ApplicationManager; import com.intellij.openapi.util.Clock; -import com.intellij.util.Consumer; import gnu.trove.TIntHashSet; import org.jetbrains.annotations.TestOnly; @@ -115,6 +100,7 @@ public class ChangeList { // todo synchronization issue: changeset may me modified while being iterated public synchronized Iterable iterChanges() { return new Iterable() { + @Override public Iterator iterator() { return new Iterator() { private final TIntHashSet recursionGuard = new TIntHashSet(1000); @@ -122,10 +108,12 @@ public class ChangeList { private ChangeSetHolder currentBlock; private ChangeSet next = fetchNext(); + @Override public boolean hasNext() { return next != null; } + @Override public ChangeSet next() { ChangeSet result = next; next = fetchNext(); @@ -152,6 +140,7 @@ public class ChangeList { return currentBlock.changeSet; } + @Override public void remove() { throw new UnsupportedOperationException(); } diff --git a/platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChange.java b/platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChange.java index ca40a1d33738..6ffd4c62fbc2 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChange.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/changes/MoveChange.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.core.changes; @@ -44,6 +30,7 @@ public class MoveChange extends StructuralChange { StreamUtil.writeString(out, myOldPath); } + @Override public String getOldPath() { return myOldPath; } diff --git a/platform/lvcs-impl/src/com/intellij/history/core/changes/PutLabelChange.java b/platform/lvcs-impl/src/com/intellij/history/core/changes/PutLabelChange.java index 8926241664ca..43604723d2fb 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/changes/PutLabelChange.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/changes/PutLabelChange.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.core.changes; @@ -75,10 +61,12 @@ public class PutLabelChange extends Change { return false; } + @Override public boolean isCreationalFor(String path) { return false; } + @Override public List getContentsToPurge() { return Collections.emptyList(); } diff --git a/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java b/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java index 1c049a2d2b4e..b5479e53ec1c 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/revisions/Difference.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.core.revisions; @@ -77,6 +63,7 @@ public class Difference { if (e == null) return null; return new ByteBackedContentRevision() { + @Override @Nullable public String getContent() throws VcsException { if (e.isDirectory()) return null; @@ -90,11 +77,13 @@ public class Difference { return e.getContent().getBytes(); } + @Override @NotNull public FilePath getFile() { return VcsUtil.getFilePath(new File(e.getPath()), e.isDirectory()); } + @Override @NotNull public VcsRevisionNumber getRevisionNumber() { return VcsRevisionNumber.NULL; diff --git a/platform/lvcs-impl/src/com/intellij/history/core/tree/DirectoryEntry.java b/platform/lvcs-impl/src/com/intellij/history/core/tree/DirectoryEntry.java index 21afb6bc07b5..753d25beb8ba 100644 --- a/platform/lvcs-impl/src/com/intellij/history/core/tree/DirectoryEntry.java +++ b/platform/lvcs-impl/src/com/intellij/history/core/tree/DirectoryEntry.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.core.tree; @@ -79,6 +65,7 @@ public class DirectoryEntry extends Entry { unsafeAddChild(child); } + @Override public void addChildren(Collection children) { myChildren.ensureCapacity(myChildren.size() + children.size()); for (Entry each : children) { diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java b/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java index a76131997548..533fdd590049 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/IdeaGateway.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2014 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration; import com.intellij.history.core.LocalHistoryFacade; @@ -116,6 +102,7 @@ public class IdeaGateway { ourCurrentEventDispatchContext.set(this); } + @Override public void close() { ourCurrentEventDispatchContext.set(myPreviousContext); if (myPreviousContext != null && myPreviousContext.myFilterData == null && myFilterData != null) { diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryActionImpl.java b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryActionImpl.java index cbfe083dd290..633be83fbac3 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryActionImpl.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/LocalHistoryActionImpl.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration; @@ -31,6 +17,7 @@ public class LocalHistoryActionImpl implements LocalHistoryAction { myDispatcher.startAction(); } + @Override public void finish() { myDispatcher.finishAction(myName); } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/revertion/SelectionReverter.java b/platform/lvcs-impl/src/com/intellij/history/integration/revertion/SelectionReverter.java index c7ee3789273e..92bb53d92228 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/revertion/SelectionReverter.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/revertion/SelectionReverter.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.revertion; @@ -66,8 +52,10 @@ public class SelectionReverter extends Reverter { return Collections.singletonList(file); } + @Override protected void doRevert() throws IOException, FilesTooBigForDiffException { Block b = myCalculator.getSelectionFor(myLeftRevision, new Progress() { + @Override public void processed(int percentage) { // should be already processed. } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/revertion/UndoChangeRevertingVisitor.java b/platform/lvcs-impl/src/com/intellij/history/integration/revertion/UndoChangeRevertingVisitor.java index 19e0206a6252..a0dd2d2839e1 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/revertion/UndoChangeRevertingVisitor.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/revertion/UndoChangeRevertingVisitor.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.revertion; @@ -268,6 +254,7 @@ public class UndoChangeRevertingVisitor extends ChangeVisitor { this.isReadOnly = isReadOnly; } + @Override public void apply() throws IOException { ReadOnlyAttributeUtil.setReadOnlyAttribute(myFile, isReadOnly); } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryGroup.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryGroup.java index 5a7a43da9c4a..85e1f8e8ee51 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryGroup.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/actions/LocalHistoryGroup.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.ui.actions; @@ -28,6 +14,7 @@ import org.jetbrains.annotations.NotNull; public class LocalHistoryGroup extends NonTrivialActionGroup implements DumbAware { + @Override public void update(@NotNull AnActionEvent e) { Project project = e.getProject(); VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE); diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/models/EntireFileHistoryDialogModel.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/models/EntireFileHistoryDialogModel.java index 04b8039120d1..d9c70f4d241e 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/models/EntireFileHistoryDialogModel.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/models/EntireFileHistoryDialogModel.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.ui.models; @@ -26,6 +12,7 @@ public class EntireFileHistoryDialogModel extends FileHistoryDialogModel { super(p, gw, vcs, f); } + @Override public FileDifferenceModel getDifferenceModel() { return new EntireFileDifferenceModel(myProject, myGateway, getLeftEntry(), getRightEntry(), isCurrentRevisionSelected()); } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/HistoryDialog.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/HistoryDialog.java index 6a55fdf64337..a00e9d606e59 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/HistoryDialog.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/HistoryDialog.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2016 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.ui.views; @@ -117,6 +103,7 @@ public abstract class HistoryDialog extends FrameW myUpdateQueue.setRestartTimerOnAdd(true); facade.addListener(new LocalHistoryFacade.Listener() { + @Override public void changeSetFinished() { scheduleRevisionsUpdate(null); } @@ -190,6 +177,7 @@ public abstract class HistoryDialog extends FrameW myToolBar = createRevisionsToolbar(actions); myRevisionsList = new RevisionsList(new RevisionsList.SelectionListener() { + @Override public void revisionsSelected(final int first, final int last) { scheduleDiffUpdate(Couple.of(first, last)); } @@ -227,6 +215,7 @@ public abstract class HistoryDialog extends FrameW private void addPopupMenuToComponent(JComponent comp, final ActionGroup ag) { comp.addMouseListener(new PopupHandler() { + @Override public void invokePopup(Component c, int x, int y) { ActionPopupMenu m = createPopupMenu(ag); m.getComponent().show(c, x, y); @@ -260,6 +249,7 @@ public abstract class HistoryDialog extends FrameW return getPriority() >= update1.getPriority(); } + @Override public void run() { if (isDisposed() || myProject.isDisposed()) return; @@ -325,6 +315,7 @@ public abstract class HistoryDialog extends FrameW final Ref requestRef = new Ref<>(); new Task.Modal(myProject, message("message.processing.revisions"), false) { + @Override public void run(@NotNull final ProgressIndicator i) { i.setIndeterminate(false); ApplicationManager.getApplication().runReadAction(() -> { @@ -555,14 +546,17 @@ public abstract class HistoryDialog extends FrameW myIndicator = i; } + @Override public void processingLeftRevision() { myIndicator.setText(message("message.processing.left.revision")); } + @Override public void processingRightRevision() { myIndicator.setText(message("message.processing.right.revision")); } + @Override public void processed(int percentage) { myIndicator.setFraction(percentage / 100.0); } diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangeDialog.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangeDialog.java index 4471f80b96ca..e64184965b85 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangeDialog.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangeDialog.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.ui.views; @@ -26,7 +12,6 @@ import com.intellij.openapi.project.Project; import com.intellij.util.ui.UIUtil; import javax.swing.*; -import javax.swing.border.Border; import java.awt.*; import java.awt.event.ActionEvent; @@ -64,6 +49,7 @@ public class RecentChangeDialog extends DirectoryHistoryDialog { private JPanel createButtonsPanel() { AbstractAction revert = new AbstractAction() { + @Override public void actionPerformed(ActionEvent e) { revert(); close(); diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangesPopup.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangesPopup.java index c0b1b9725f7b..c220c7897762 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangesPopup.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RecentChangesPopup.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.ui.views; @@ -65,6 +51,7 @@ public class RecentChangesPopup { mySpacePanel.setPreferredSize(d); } + @Override public Component getListCellRendererComponent(JList l, Object val, int i, boolean isSelected, boolean cellHasFocus) { RecentChange c = (RecentChange)val; myActionLabel.setText(c.getChangeName()); diff --git a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java index 70bd064e4911..126414213bd9 100644 --- a/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java +++ b/platform/lvcs-impl/src/com/intellij/history/integration/ui/views/RevisionsList.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2013 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.integration.ui.views; @@ -47,8 +33,8 @@ import javax.swing.table.AbstractTableModel; import javax.swing.table.DefaultTableCellRenderer; import javax.swing.table.TableCellRenderer; import java.awt.*; -import java.util.*; import java.util.List; +import java.util.*; public class RevisionsList { public static final int RECENT_PERIOD = 12; @@ -84,6 +70,7 @@ public class RevisionsList { private int mySelectedRow2 = 0; private final SelectionListener mySelectionListener = l; + @Override public void valueChanged(ListSelectionEvent e) { if (e.getValueIsAdjusting()) return; @@ -165,14 +152,17 @@ public class RevisionsList { myPeriods = periods; } + @Override public int getColumnCount() { return 1; } + @Override public int getRowCount() { return myRevisions.size(); } + @Override public RevisionItem getValueAt(int rowIndex, int columnIndex) { return myRevisions.get(rowIndex); } @@ -290,6 +280,7 @@ public class RevisionsList { myTitleLabel.setComponentStyle(UIUtil.ComponentStyle.REGULAR); } + @Override public Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column) { if (value == null) return myWrapperPanel; // null erroneously comes from JPanel.getAccessibleChild diff --git a/platform/lvcs-impl/src/com/intellij/history/utils/RunnableAdapter.java b/platform/lvcs-impl/src/com/intellij/history/utils/RunnableAdapter.java index 865b81bb2ecd..2cb5564ff290 100644 --- a/platform/lvcs-impl/src/com/intellij/history/utils/RunnableAdapter.java +++ b/platform/lvcs-impl/src/com/intellij/history/utils/RunnableAdapter.java @@ -1,22 +1,9 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.history.utils; public abstract class RunnableAdapter implements Runnable { + @Override public void run() { try { doRun(); diff --git a/platform/lvcs-impl/src/com/intellij/openapi/command/impl/ChangeRange.java b/platform/lvcs-impl/src/com/intellij/openapi/command/impl/ChangeRange.java index fd2d33ef361f..18cf4df98a30 100644 --- a/platform/lvcs-impl/src/com/intellij/openapi/command/impl/ChangeRange.java +++ b/platform/lvcs-impl/src/com/intellij/openapi/command/impl/ChangeRange.java @@ -1,18 +1,4 @@ -/* - * Copyright 2000-2009 JetBrains s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ +// Copyright 2000-2018 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. package com.intellij.openapi.command.impl; @@ -47,6 +33,7 @@ public class ChangeRange { final Ref first = new Ref<>(); final Ref last = new Ref<>(); LocalHistoryFacade.Listener l = new LocalHistoryFacade.Listener() { + @Override public void changeAdded(Change c) { if (first.isNull()) first.set(c.getId()); last.set(c.getId()); diff --git a/platform/platform-impl/src/com/intellij/openapi/command/impl/DocumentUndoProvider.java b/platform/platform-impl/src/com/intellij/openapi/command/impl/DocumentUndoProvider.java index d7665e025eb1..3f7688fd3419 100644 --- a/platform/platform-impl/src/com/intellij/openapi/command/impl/DocumentUndoProvider.java +++ b/platform/platform-impl/src/com/intellij/openapi/command/impl/DocumentUndoProvider.java @@ -18,7 +18,7 @@ import com.intellij.util.messages.MessageBusConnection; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; -class DocumentUndoProvider { +public class DocumentUndoProvider { private static final Key UNDOING_EDITOR_CHANGE = Key.create("DocumentUndoProvider.UNDOING_EDITOR_CHANGE"); DocumentUndoProvider(@Nullable Project project, @NotNull MessageBusConnection busConnection) {