blob: 80d75ff0e404d7e30957ed5c1c463c0d1d611734 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/**********************************************************************
* Copyright (c) 2010 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*******************************************************************************/
package org.eclipse.ptp.etfw.feedback.sample.actions;
import org.eclipse.core.resources.IMarker;
import org.eclipse.core.runtime.CoreException;
import org.eclipse.jface.dialogs.MessageDialog;
import org.eclipse.ptp.etfw.feedback.AbstractFeedbackAction;
import org.eclipse.ptp.etfw.feedback.obj.IFeedbackItem;
import org.eclipse.ptp.etfw.feedback.sample.Activator;
/**
* A sample action that can be added to the ETFw Feedback view
* @author beth
*
*/
public class SampleFeedbackAction extends AbstractFeedbackAction {
public void run(IMarker marker) {
String name="(unknown)";
try {
name = (String)marker.getAttribute("name");
} catch (CoreException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
MessageDialog.openInformation(null, "Sample action", "Do something interesting here with marker: "+name);
}
public void run(IFeedbackItem item) {
MessageDialog.openInformation(null, "Sample action", "Do something interesting here with IFeedbackItem");
}
public String getToolTip() {
return "SampleFeedbackAction tooltip";
}
@Override
public String getText() {
return "SampleFeedbackAction text";
}
@Override
public String getPluginId() {
return Activator.PLUGIN_ID;
}
}
|