Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMykola Nikishov2019-05-10 09:10:58 -0400
committerAlexander Kurtakov2019-05-15 03:18:02 -0400
commitcef2743fe646b64e80a39c0d55ab19d7cd2d1ef9 (patch)
treec423e1e8cac830aedd5cceebb975234ece2db63c
parenta0eda99eb9e80b94f6153e1bc4ab7db637353b7f (diff)
downloadrt.equinox.p2-cef2743fe646b64e80a39c0d55ab19d7cd2d1ef9.tar.gz
rt.equinox.p2-cef2743fe646b64e80a39c0d55ab19d7cd2d1ef9.tar.xz
rt.equinox.p2-cef2743fe646b64e80a39c0d55ab19d7cd2d1ef9.zip
Apply @Override to p2 examplesI20190515-1800
Change-Id: I4b78bff37479c1bc85e024882990c92f6d5ba3c8 Signed-off-by: Mykola Nikishov <mn@mn.com.ua>
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java10
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java16
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java3
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java2
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java2
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java1
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java13
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java1
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java1
-rw-r--r--examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java3
10 files changed, 32 insertions, 20 deletions
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java
index be08d5ac8..d7ffdafe9 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Activator.java
@@ -21,19 +21,13 @@ public class Activator extends AbstractUIPlugin {
public Activator() {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java
index 333f4c610..81a5546ca 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Application.java
@@ -11,9 +11,7 @@ import org.eclipse.ui.PlatformUI;
*/
public class Application implements IApplication {
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#start(org.eclipse.equinox.app.IApplicationContext)
- */
+ @Override
public Object start(IApplicationContext context) {
Display display = PlatformUI.createDisplay();
try {
@@ -27,19 +25,15 @@ public class Application implements IApplication {
}
}
- /* (non-Javadoc)
- * @see org.eclipse.equinox.app.IApplication#stop()
- */
+ @Override
public void stop() {
final IWorkbench workbench = PlatformUI.getWorkbench();
if (workbench == null)
return;
final Display display = workbench.getDisplay();
- display.syncExec(new Runnable() {
- public void run() {
- if (!display.isDisposed())
- workbench.close();
- }
+ display.syncExec(() -> {
+ if (!display.isDisposed())
+ workbench.close();
});
}
}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java
index 588f0106b..55bcfbaef 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationActionBarAdvisor.java
@@ -40,6 +40,7 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
super(configurer);
}
+ @Override
protected void makeActions(final IWorkbenchWindow window) {
// Creates the actions and registers them.
// Registering is needed to ensure that key bindings work.
@@ -67,6 +68,7 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
register(messagePopupAction);
}
+ @Override
protected void fillMenuBar(IMenuManager menuBar) {
MenuManager fileMenu = new MenuManager("&File", IWorkbenchActionConstants.M_FILE);
// XXX Window menu
@@ -99,6 +101,7 @@ public class ApplicationActionBarAdvisor extends ActionBarAdvisor {
}
+ @Override
protected void fillCoolBar(ICoolBarManager coolBar) {
IToolBarManager toolbar = new ToolBarManager(SWT.FLAT | SWT.RIGHT);
coolBar.add(new ToolBarContributionItem(toolbar, "main"));
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java
index effefa115..31b815728 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchAdvisor.java
@@ -10,10 +10,12 @@ import org.eclipse.ui.application.WorkbenchWindowAdvisor;
*/
public class ApplicationWorkbenchAdvisor extends WorkbenchAdvisor {
+ @Override
public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor(IWorkbenchWindowConfigurer configurer) {
return new ApplicationWorkbenchWindowAdvisor(configurer);
}
+ @Override
public String getInitialWindowPerspectiveId() {
return Perspective.ID;
}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java
index 0391fe090..c1a6c170f 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/ApplicationWorkbenchWindowAdvisor.java
@@ -12,10 +12,12 @@ public class ApplicationWorkbenchWindowAdvisor extends WorkbenchWindowAdvisor {
super(configurer);
}
+ @Override
public ActionBarAdvisor createActionBarAdvisor(IActionBarConfigurer configurer) {
return new ApplicationActionBarAdvisor(configurer);
}
+ @Override
public void preWindowOpen() {
IWorkbenchWindowConfigurer configurer = getWindowConfigurer();
configurer.setInitialSize(new Point(600, 400));
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java
index 223749337..b537507d2 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/MessagePopupAction.java
@@ -19,6 +19,7 @@ public class MessagePopupAction extends Action {
setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdkui.Activator.getImageDescriptor("/icons/sample3.gif"));
}
+ @Override
public void run() {
MessageDialog.openInformation(window.getShell(), "Open", "Open Message Dialog!");
}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java
index 2f0335398..f2c60ca8b 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/NavigationView.java
@@ -34,6 +34,7 @@ public class NavigationView extends ViewPart {
public TreeParent getParent() {
return parent;
}
+ @Override
public String toString() {
return getName();
}
@@ -64,16 +65,20 @@ public class NavigationView extends ViewPart {
class ViewContentProvider implements IStructuredContentProvider,
ITreeContentProvider {
+ @Override
public void inputChanged(Viewer v, Object oldInput, Object newInput) {
}
+ @Override
public void dispose() {
}
+ @Override
public Object[] getElements(Object parent) {
return getChildren(parent);
}
+ @Override
public Object getParent(Object child) {
if (child instanceof TreeObject) {
return ((TreeObject)child).getParent();
@@ -81,6 +86,7 @@ public class NavigationView extends ViewPart {
return null;
}
+ @Override
public Object[] getChildren(Object parent) {
if (parent instanceof TreeParent) {
return ((TreeParent)parent).getChildren();
@@ -88,7 +94,8 @@ public class NavigationView extends ViewPart {
return new Object[0];
}
- public boolean hasChildren(Object parent) {
+ @Override
+ public boolean hasChildren(Object parent) {
if (parent instanceof TreeParent)
return ((TreeParent)parent).hasChildren();
return false;
@@ -97,9 +104,11 @@ public class NavigationView extends ViewPart {
class ViewLabelProvider extends LabelProvider {
+ @Override
public String getText(Object obj) {
return obj.toString();
}
+ @Override
public Image getImage(Object obj) {
String imageKey = ISharedImages.IMG_OBJ_ELEMENT;
if (obj instanceof TreeParent)
@@ -135,6 +144,7 @@ public class NavigationView extends ViewPart {
* This is a callback that will allow us to create the viewer and initialize
* it.
*/
+ @Override
public void createPartControl(Composite parent) {
viewer = new TreeViewer(parent, SWT.MULTI | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
viewer.setContentProvider(new ViewContentProvider());
@@ -145,6 +155,7 @@ public class NavigationView extends ViewPart {
/**
* Passing the focus request to the viewer's control.
*/
+ @Override
public void setFocus() {
viewer.getControl().setFocus();
}
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java
index ea54ddffc..ee4f3af73 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/OpenViewAction.java
@@ -24,6 +24,7 @@ public class OpenViewAction extends Action {
setImageDescriptor(org.eclipse.equinox.p2.examples.rcp.sdkui.Activator.getImageDescriptor("/icons/sample2.gif"));
}
+ @Override
public void run() {
if(window != null) {
try {
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java
index d25e02381..3cc8b2dcb 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/Perspective.java
@@ -11,6 +11,7 @@ public class Perspective implements IPerspectiveFactory {
*/
public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdkui.perspective";
+ @Override
public void createInitialLayout(IPageLayout layout) {
String editorArea = layout.getEditorArea();
layout.setEditorAreaVisible(false);
diff --git a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java
index 7a3b0219a..663660d7f 100644
--- a/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java
+++ b/examples/org.eclipse.equinox.p2.examples.rcp.sdkui/src/org/eclipse/equinox/p2/examples/rcp/sdkui/View.java
@@ -18,6 +18,7 @@ public class View extends ViewPart {
public static final String ID = "org.eclipse.equinox.p2.examples.rcp.sdkui.view";
+ @Override
public void createPartControl(Composite parent) {
Composite top = new Composite(parent, SWT.NONE);
GridLayout layout = new GridLayout();
@@ -49,6 +50,7 @@ public class View extends ViewPart {
final Link link = new Link(banner, SWT.NONE);
link.setText("<a>nicole@mail.org</a>");
link.addSelectionListener(new SelectionAdapter() {
+ @Override
public void widgetSelected(SelectionEvent e) {
MessageDialog.openInformation(getSite().getShell(), "Not Implemented", "Imagine the address book or a new message being created now.");
}
@@ -72,6 +74,7 @@ public class View extends ViewPart {
text.setLayoutData(new GridData(GridData.FILL_BOTH));
}
+ @Override
public void setFocus() {
}
}

Back to the top