File tree 2 files changed +50
-0
lines changed
src/de/bodden/tamiflex/action
2 files changed +50
-0
lines changed Original file line number Diff line number Diff line change 111
111
id =" ReflectionView.icons.playInLaunchConfig" >
112
112
</launchConfigurationTypeImage >
113
113
</extension >
114
+ <extension point =" org.eclipse.ui.popupMenus" >
115
+ <objectContribution
116
+ adaptable =" false"
117
+ id =" de.bodden.tamiflex.objectContributions.compare"
118
+ nameFilter =" *.log"
119
+ objectClass =" org.eclipse.core.resources.IFile" >
120
+ <action
121
+ class =" de.bodden.tamiflex.action.Compare"
122
+ enablesFor =" 2"
123
+ id =" de.bodden.tamiflex.actions.compare"
124
+ label =" Compare Log files" >
125
+ </action >
126
+ </objectContribution >
127
+ </extension >
128
+
114
129
115
130
116
131
</plugin >
Original file line number Diff line number Diff line change
1
+ package de .bodden .tamiflex .action ;
2
+
3
+ import java .util .Iterator ;
4
+
5
+ import org .eclipse .core .resources .IFile ;
6
+ import org .eclipse .jface .action .IAction ;
7
+ import org .eclipse .jface .viewers .ISelection ;
8
+ import org .eclipse .jface .viewers .IStructuredSelection ;
9
+ import org .eclipse .ui .IObjectActionDelegate ;
10
+ import org .eclipse .ui .IWorkbenchPart ;
11
+
12
+ public class Compare implements IObjectActionDelegate {
13
+
14
+ private IFile left ;
15
+ private IFile right ;
16
+
17
+ @ Override
18
+ public void setActivePart (IAction action , IWorkbenchPart targetPart ) {
19
+ }
20
+
21
+ @ Override
22
+ public void run (IAction action ) {
23
+ System .err .println ("About to compare " +left +" to " +right );
24
+ }
25
+
26
+ @ Override
27
+ public void selectionChanged (IAction action , ISelection selection ) {
28
+ IStructuredSelection sl = (IStructuredSelection ) selection ;
29
+ Iterator <?> iter = sl .iterator ();
30
+ left = (IFile ) iter .next ();
31
+ right = (IFile ) iter .next ();
32
+ }
33
+
34
+
35
+ }
You can’t perform that action at this time.
0 commit comments