Skip to content

Commit

Permalink
Added Copyright to the action class created.
Browse files Browse the repository at this point in the history
  • Loading branch information
sonakshisaxena1 committed Nov 19, 2024
1 parent 6fcefcf commit 5e12a7c
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1416,6 +1416,7 @@ add.byte.order.mark.to=Add byte order mark to {0}
remove.BOM=Remove BOM
add.BOM=Add BOM
removing.BOM=Removing BOM
recapture.trace = Re-Capture Trace
# suppress inspection "UnusedProperty"
notification.group.failed.to.remove.bom=Failed to remove BOM
notification.title.was.unable.to.remove.bom.in=Was unable to remove BOM in {0} {0,choice,1#file|2#files}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/***
* Copyright 2024 Google LLC
* 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
*
* https://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.
***/
package com.intellij.openapi.editor.actions;

import com.intellij.ide.IdeBundle;
import com.intellij.openapi.actionSystem.*;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.vfs.VirtualFile;
import org.jetbrains.annotations.NotNull;

public final class SherlockCaptureAction extends AnAction {
private static final Logger LOG = Logger.getInstance(SherlockCaptureAction.class);

public SherlockCaptureAction() {
super(IdeBundle.messagePointer("recapture.trace"));
}

@Override
public void actionPerformed(@NotNull AnActionEvent e) {
VirtualFile file = e.getData(CommonDataKeys.VIRTUAL_FILE);
String fileExtension = file.getExtension();
if (file != null && ("perfetto".equals(fileExtension) || "pftrace".equals(fileExtension))) {
LOG.info("Clicked on Re-capture button");
}
}
}
6 changes: 6 additions & 0 deletions platform/platform-resources/src/idea/LangActions.xml
Original file line number Diff line number Diff line change
Expand Up @@ -888,6 +888,12 @@
<reference ref="ProjectViewPopupMenuSettingsGroup"/>
</group>

<group id = "ReCaptureAction.Group">
<action id="ReCaptureAction" class="com.intellij.openapi.editor.actions.SherlockCaptureAction" text="Re-Capture">
<add-to-group group-id="ProjectViewPopupMenu" anchor="first"/>
</action>
</group>

<group id="RemoveBom.Group">
<action id="RemoveBom" class="com.intellij.openapi.editor.actions.RemoveBomAction"/>
<add-to-group group-id="FilePropertiesGroup" anchor="after" relative-to-action="ChangeFileEncodingAction"/>
Expand Down

0 comments on commit 5e12a7c

Please sign in to comment.