Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Kurtakov2015-01-16 03:19:33 -0500
committerAlexander Kurtakov2015-01-16 03:19:33 -0500
commitcf782bef8144c630c0ea9521c42cfc62b7b28749 (patch)
tree4dd68e1f6d8d0c6d5128b50a518fd670d24ca77b
parent1ad398c952cf65a06a8c45b79460569993773afe (diff)
downloadeclipse.platform.swt-cf782bef8144c630c0ea9521c42cfc62b7b28749.tar.gz
eclipse.platform.swt-cf782bef8144c630c0ea9521c42cfc62b7b28749.tar.xz
eclipse.platform.swt-cf782bef8144c630c0ea9521c42cfc62b7b28749.zip
Bug 457657 - Move swt.examples to Java 1.6
Bump BREE, fix new warnings and enable save actions. Change-Id: I4b64b22e5b05a296a9704255684346972c4afad6 Signed-off-by: Alexander Kurtakov <akurtako@redhat.com>
-rw-r--r--examples/org.eclipse.swt.examples.browser.demos/.classpath2
-rw-r--r--examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.ui.prefs60
-rw-r--r--examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java26
-rw-r--r--examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java20
-rw-r--r--examples/org.eclipse.swt.examples.launcher/.classpath2
-rw-r--r--examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.ui.prefs60
-rw-r--r--examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java35
-rw-r--r--examples/org.eclipse.swt.examples.views/.classpath2
-rw-r--r--examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.swt.examples/.classpath2
-rw-r--r--examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs60
-rw-r--r--examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF2
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleActionExample.java1
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleValueExample.java24
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/BarChart.java29
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java42
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java33
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java33
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java63
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java51
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/Shape.java29
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java38
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java19
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java24
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java61
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java50
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java49
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java39
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java28
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java30
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java18
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java18
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java61
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java72
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java30
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolTipTab.java22
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java31
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java72
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java76
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java25
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java15
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java19
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CountDownTab.java22
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesSWTTab.java20
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesTab.java20
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java23
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomFontTab.java32
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java34
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientTab.java5
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java21
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsExample.java58
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java24
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java19
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineCapTab.java19
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineJoinTab.java22
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineStyleTab.java22
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java14
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingAnimTab.java19
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java23
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathTab.java23
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java23
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/SpiralTab.java22
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java11
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/TextAntialiasTab.java21
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java15
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java47
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java82
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java19
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java35
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java25
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java56
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java5
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java1
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java14
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java9
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java49
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java28
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java4
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java13
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java25
-rw-r--r--examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java86
92 files changed, 2059 insertions, 375 deletions
diff --git a/examples/org.eclipse.swt.examples.browser.demos/.classpath b/examples/org.eclipse.swt.examples.browser.demos/.classpath
index 64c5e31b7a..ad32c83a78 100644
--- a/examples/org.eclipse.swt.examples.browser.demos/.classpath
+++ b/examples/org.eclipse.swt.examples.browser.demos/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.core.prefs
index 416f4fb696..8000cd6ca6 100644
--- a/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.core.prefs
@@ -1,11 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.ui.prefs b/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..5b25dc14e5
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.browser.demos/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
index 1e014d02f1..886292931c 100644
--- a/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.browser.demos/META-INF/MANIFEST.MF
@@ -11,4 +11,4 @@ Export-Package: org.eclipse.swt.examples.browser.demos,
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java
index 8053165e0b..ff47fceedf 100644
--- a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java
+++ b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/EditorTab.java
@@ -10,11 +10,25 @@
*******************************************************************************/
package org.eclipse.swt.examples.browser.demos.views;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.browser.*;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
public class EditorTab {
Browser browser;
@@ -73,6 +87,7 @@ public class EditorTab {
sashData.bottom = new FormAttachment(100, 0);
sash.setLayoutData(sashData);
sash.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
Rectangle rect = sash.getBounds();
Rectangle parentRect = sash.getParent().getClientArea();
@@ -135,6 +150,7 @@ public class EditorTab {
parent.layout();
Listener listener = new Listener() {
+ @Override
public void handleEvent(Event e) {
Widget w = e.widget;
if (w == htmlButton) browser.setText(htmlText.getText());
diff --git a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java
index 513f12efe1..3f7d803c89 100644
--- a/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java
+++ b/examples/org.eclipse.swt.examples.browser.demos/src/org/eclipse/swt/examples/browser/demos/views/PawnTab.java
@@ -11,11 +11,19 @@
package org.eclipse.swt.examples.browser.demos.views;
import org.eclipse.jface.action.Action;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.browser.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.LocationEvent;
+import org.eclipse.swt.browser.LocationListener;
import org.eclipse.swt.examples.browser.demos.BrowserDemoPlugin;
import org.eclipse.swt.examples.browser.demos.Pawns;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.TabItem;
public class PawnTab {
@@ -70,6 +78,7 @@ public class PawnTab {
MenuItem item2 = new MenuItem(menu, SWT.PUSH);
item2.setText("End Game");
item2.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
game = null;
isWhite = true;
@@ -130,8 +139,10 @@ public class PawnTab {
}
public class ReversiListener implements LocationListener {
+ @Override
public void changed(LocationEvent e) {
}
+ @Override
public void changing(LocationEvent e) {
try {
final Browser browser = (Browser)e.widget;
@@ -141,6 +152,7 @@ public class PawnTab {
if (computer) ttr = new Pawns();
for (int i = 0; i < 5; i++) game[(int)(Math.random()*game.length)][(int)(Math.random()*game[0].length)] = WALL;
e.display.asyncExec(new Runnable() {
+ @Override
public void run() {
browser.setText(getHtml(TYPE_BOARD));
}});
@@ -153,6 +165,7 @@ public class PawnTab {
URL_CSS = PLUGIN_PATH+CSS_FOLDER+"/style.css";
URL_WELCOME = PLUGIN_PATH+CSS_FOLDER+"/welcome.html";
e.display.asyncExec(new Runnable() {
+ @Override
public void run() {
browser.setUrl(URL_WELCOME);
}});
@@ -247,6 +260,7 @@ public class PawnTab {
public static void play(final Display display, final Browser browser, int delay) {
ttr.playRequest(game, BLACK);
display.timerExec(3000, new Runnable() {
+ @Override
public void run() {
ttr.getBestMove(move);
boolean hasMore = add(move[0], move[1], BLACK);
diff --git a/examples/org.eclipse.swt.examples.launcher/.classpath b/examples/org.eclipse.swt.examples.launcher/.classpath
index 64c5e31b7a..ad32c83a78 100644
--- a/examples/org.eclipse.swt.examples.launcher/.classpath
+++ b/examples/org.eclipse.swt.examples.launcher/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.core.prefs
index 416f4fb696..8000cd6ca6 100644
--- a/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.core.prefs
@@ -1,11 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.ui.prefs b/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..5b25dc14e5
--- /dev/null
+++ b/examples/org.eclipse.swt.examples.launcher/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
index d847ea02c2..6aacc1210a 100644
--- a/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.launcher/META-INF/MANIFEST.MF
@@ -9,4 +9,4 @@ Bundle-Localization: plugin
Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java
index 671557af16..660249d314 100644
--- a/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java
+++ b/examples/org.eclipse.swt.examples.launcher/src/org/eclipse/swt/examples/launcher/LauncherView.java
@@ -10,13 +10,29 @@
*******************************************************************************/
package org.eclipse.swt.examples.launcher;
+import java.lang.reflect.Method;
+
import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.ui.*;
-import org.eclipse.ui.part.*;
-import java.lang.reflect.*;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TreeListener;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.IWorkbenchPartSite;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.part.ViewPart;
/**
* Launcher uses <code>org.eclipse.swt</code>
@@ -60,10 +76,12 @@ public class LauncherView extends ViewPart {
gridData.horizontalSpan = 2;
launchTree.setLayoutData(gridData);
launchTree.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent event) {
final ItemDescriptor item = getSelectedItem();
setDescriptionByItem(item);
}
+ @Override
public void widgetDefaultSelected(SelectionEvent event) {
final ItemDescriptor item = getSelectedItem();
setDescriptionByItem(item);
@@ -79,11 +97,13 @@ public class LauncherView extends ViewPart {
}
});
launchTree.addTreeListener(new TreeListener() {
+ @Override
public void treeCollapsed(TreeEvent event) {
final TreeItem item = (TreeItem) event.item;
if (item == null) return;
item.setImage(LauncherPlugin.images[LauncherPlugin.liClosedFolder]);
}
+ @Override
public void treeExpanded(TreeEvent event) {
final TreeItem item = (TreeItem) event.item;
if (item == null) return;
@@ -94,9 +114,11 @@ public class LauncherView extends ViewPart {
runButton = new Button(launchGroup, SWT.PUSH);
runButton.setText(LauncherPlugin.getResourceString("view.launchButton.text"));
runButton.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent event) {
launchItem(getSelectedItem());
}
+ @Override
public void widgetDefaultSelected(SelectionEvent event) {
}
});
@@ -143,6 +165,7 @@ public class LauncherView extends ViewPart {
public void setItemDescriptors(final ItemTreeNode newRoot) {
if (workbenchShell == null) return;
workbenchShell.getDisplay().syncExec(new Runnable() {
+ @Override
public void run() {
if ((launchTree == null) || (launchTree.isDisposed())) return;
launchTree.removeAll();
diff --git a/examples/org.eclipse.swt.examples.views/.classpath b/examples/org.eclipse.swt.examples.views/.classpath
index 64c5e31b7a..ad32c83a78 100644
--- a/examples/org.eclipse.swt.examples.views/.classpath
+++ b/examples/org.eclipse.swt.examples.views/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs
index 416f4fb696..8000cd6ca6 100644
--- a/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.swt.examples.views/.settings/org.eclipse.jdt.core.prefs
@@ -1,11 +1,11 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
index ab2da4d5e8..208eeaa3f7 100644
--- a/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples.views/META-INF/MANIFEST.MF
@@ -9,4 +9,4 @@ Require-Bundle: org.eclipse.core.runtime,
org.eclipse.ui,
org.eclipse.swt.examples
Bundle-ActivationPolicy: lazy
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
diff --git a/examples/org.eclipse.swt.examples/.classpath b/examples/org.eclipse.swt.examples/.classpath
index 64c5e31b7a..ad32c83a78 100644
--- a/examples/org.eclipse.swt.examples/.classpath
+++ b/examples/org.eclipse.swt.examples/.classpath
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="src"/>
<classpathentry kind="output" path="bin"/>
diff --git a/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.core.prefs
index 416f4fb696..ef8a789ca0 100644
--- a/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.core.prefs
+++ b/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.core.prefs
@@ -1,11 +1,12 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
-org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
org.eclipse.jdt.core.compiler.debug.localVariable=generate
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.5
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs b/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs
new file mode 100644
index 0000000000..5b25dc14e5
--- /dev/null
+++ b/examples/org.eclipse.swt.examples/.settings/org.eclipse.jdt.ui.prefs
@@ -0,0 +1,60 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_functional_interfaces=false
+sp_cleanup.convert_to_enhanced_for_loop=false
+sp_cleanup.correct_indentation=false
+sp_cleanup.format_source_code=false
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.insert_inferred_type_arguments=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=false
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=false
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_redundant_type_arguments=true
+sp_cleanup.remove_trailing_whitespaces=false
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=false
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=false
+sp_cleanup.sort_members_all=false
+sp_cleanup.use_anonymous_class_creation=false
+sp_cleanup.use_blocks=false
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_lambda=true
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
+sp_cleanup.use_type_arguments=false
diff --git a/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF b/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF
index aa5be166f0..ab5bfc54f2 100644
--- a/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF
+++ b/examples/org.eclipse.swt.examples/META-INF/MANIFEST.MF
@@ -5,7 +5,7 @@ Bundle-SymbolicName: org.eclipse.swt.examples; singleton:=true
Bundle-Version: 3.104.0.qualifier
Bundle-Vendor: %providerName
Bundle-Localization: plugin
-Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: org.eclipse.swt.examples.accessibility,
org.eclipse.swt.examples.addressbook,
org.eclipse.swt.examples.browserexample,
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleActionExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleActionExample.java
index 34a4245eb1..da927f6160 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleActionExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleActionExample.java
@@ -58,6 +58,7 @@ public class AccessibleActionExample {
}
};
customButton.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
Rectangle clientArea = customButton.getClientArea();
Point stringExtent = e.gc.stringExtent(buttonText);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleValueExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleValueExample.java
index 4f05fbf89f..bc1706c213 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleValueExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/AccessibleValueExample.java
@@ -10,12 +10,23 @@
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.accessibility.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleValueAdapter;
+import org.eclipse.swt.accessibility.AccessibleValueEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
/**
* This example shows how to use an AccessibleValueListener to provide
@@ -34,6 +45,7 @@ public class AccessibleValueExample {
final Canvas canvas = new Canvas(shell, SWT.DOUBLE_BUFFERED);
canvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
Rectangle rect = canvas.getClientArea();
String val = String.valueOf(value);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/BarChart.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/BarChart.java
index 7b28423992..e0904a8876 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/BarChart.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/BarChart.java
@@ -14,11 +14,28 @@ import java.text.MessageFormat;
import java.util.ResourceBundle;
import java.util.Vector;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.accessibility.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
/**
* Instances of this class represent a very simple accessible bar chart.
@@ -51,6 +68,7 @@ public class BarChart extends Canvas {
void addListeners() {
addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
GC gc = e.gc;
Rectangle rect = getClientArea();
@@ -174,6 +192,7 @@ public class BarChart extends Canvas {
});
addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
switch (e.detail) {
case SWT.TRAVERSE_TAB_NEXT:
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
index 6bff79b732..aa40352dc7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTable.java
@@ -10,11 +10,40 @@
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-import org.eclipse.swt.*;
-import org.eclipse.swt.accessibility.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleTableAdapter;
+import org.eclipse.swt.accessibility.AccessibleTableEvent;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.PaletteData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Tracker;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
/**
* Instances of this class implement a selectable user interface
@@ -165,6 +194,7 @@ public CTable (Composite parent, int style) {
clientArea = getClientArea ();
Listener listener = new Listener () {
+ @Override
public void handleEvent (Event event) {
handleEvents (event);
}
@@ -195,6 +225,7 @@ public CTable (Composite parent, int style) {
header.addListener (SWT.MenuDetect, listener);
toolTipListener = new Listener () {
+ @Override
public void handleEvent (Event event) {
switch (event.type) {
case SWT.MouseHover:
@@ -2099,6 +2130,7 @@ static void initImages (final Display display) {
}
display.disposeExec (new Runnable () {
+ @Override
public void run() {
Image unchecked = (Image) display.getData (ID_UNCHECKED);
if (unchecked != null) unchecked.dispose ();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
index 3aaf598b2d..463211f25e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableColumn.java
@@ -10,11 +10,26 @@
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-import org.eclipse.swt.*;
-import org.eclipse.swt.accessibility.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleTableCellEvent;
+import org.eclipse.swt.accessibility.AccessibleTableCellListener;
+import org.eclipse.swt.events.ControlListener;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.TypedListener;
+import org.eclipse.swt.widgets.Widget;
/**
* Instances of this class represent a column in a table widget.
@@ -820,27 +835,35 @@ Accessible getAccessible(final Accessible accessibleTable) {
}
});
accessible.addAccessibleTableCellListener(new AccessibleTableCellListener() {
+ @Override
public void getColumnHeaders(AccessibleTableCellEvent e) {
/* Column header does not have a header. */
}
+ @Override
public void getColumnIndex(AccessibleTableCellEvent e) {
e.index = getIndex();
}
+ @Override
public void getColumnSpan(AccessibleTableCellEvent e) {
e.count = 1; /* CTable cells only occupy one column. */
}
+ @Override
public void getRowHeaders(AccessibleTableCellEvent e) {
/* CTable does not support row headers. */
}
+ @Override
public void getRowIndex(AccessibleTableCellEvent e) {
e.index = 0;
}
+ @Override
public void getRowSpan(AccessibleTableCellEvent e) {
e.count = 1; /* CTable cells only occupy one row. */
}
+ @Override
public void getTable(AccessibleTableCellEvent e) {
e.accessible = accessibleTable;
}
+ @Override
public void isSelected(AccessibleTableCellEvent e) {
e.isSelected = false; /* CTable columns cannot be selected (only rows can be selected). */
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
index 1a5aa87eea..8061e1956e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/CTableItem.java
@@ -10,10 +10,27 @@
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-import org.eclipse.swt.*;
-import org.eclipse.swt.accessibility.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.accessibility.AccessibleTableCellEvent;
+import org.eclipse.swt.accessibility.AccessibleTableCellListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Widget;
/**
* Instances of this class represent a selectable user interface object
@@ -466,6 +483,7 @@ Accessible getAccessible(final Accessible accessibleTable, final int columnIndex
}
});
accessible.addAccessibleTableCellListener(new AccessibleTableCellListener() {
+ @Override
public void getColumnHeaders(AccessibleTableCellEvent e) {
if (parent.columns.length == 0) {
/* The CTable is being used as a list, and there are no headers. */
@@ -476,26 +494,33 @@ Accessible getAccessible(final Accessible accessibleTable, final int columnIndex
e.accessibles = new Accessible[] {column.getAccessible (accessibleTable)};
}
}
+ @Override
public void getColumnIndex(AccessibleTableCellEvent e) {
e.index = columnIndex;
}
+ @Override
public void getColumnSpan(AccessibleTableCellEvent e) {
/* CTable cells only occupy one column. */
e.count = 1;
}
+ @Override
public void getRowHeaders(AccessibleTableCellEvent e) {
/* CTable does not support row headers. */
}
+ @Override
public void getRowIndex(AccessibleTableCellEvent e) {
e.index = index;
}
+ @Override
public void getRowSpan(AccessibleTableCellEvent e) {
/* CTable cells only occupy one row. */
e.count = 1;
}
+ @Override
public void getTable(AccessibleTableCellEvent e) {
e.accessible = accessibleTable;
}
+ @Override
public void isSelected(AccessibleTableCellEvent e) {
e.isSelected = CTableItem.this.isSelected();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
index d3c5341952..c200f6baf5 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithAccessibleNamesExample.java
@@ -10,13 +10,58 @@
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.accessibility.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.Accessible;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Caret;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.widgets.Scale;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
public class ControlsWithAccessibleNamesExample {
static Display display;
@@ -361,6 +406,7 @@ public class ControlsWithAccessibleNamesExample {
// Canvas canvas, overrideCanvas;
canvas = new Canvas(shell, SWT.BORDER);
canvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
e.gc.drawString("Canvas", 15, 25);
}
@@ -382,6 +428,7 @@ public class ControlsWithAccessibleNamesExample {
});
/* Hook traverse listener to make canvas give up focus during traversal out. */
canvas.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
e.doit = true;
}
@@ -389,6 +436,7 @@ public class ControlsWithAccessibleNamesExample {
overrideCanvas = new Canvas(shell, SWT.BORDER);
overrideCanvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
e.gc.drawString("Canvas", 15, 25);
}
@@ -410,6 +458,7 @@ public class ControlsWithAccessibleNamesExample {
});
/* Hook traverse listener to make canvas give up focus during traversal out. */
overrideCanvas.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
e.doit = true;
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java
index ad3dbd4387..7bcce1967c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/ControlsWithLabelsExample.java
@@ -10,12 +10,49 @@
*******************************************************************************/
package org.eclipse.swt.examples.accessibility;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.custom.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.CLabel;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Caret;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.widgets.Scale;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.TabItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
public class ControlsWithLabelsExample {
static Display display;
@@ -190,6 +227,7 @@ public class ControlsWithLabelsExample {
canvas = new Canvas(shell, SWT.BORDER);
canvas.setLayoutData(new GridData(64, 64));
canvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
e.gc.drawString("Canvas", 15, 25);
}
@@ -206,6 +244,7 @@ public class ControlsWithLabelsExample {
});
/* Hook traverse listener to make canvas give up focus during traversal out. */
canvas.addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
e.doit = true;
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/Shape.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/Shape.java
index a2e0b58306..8b392b060e 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/Shape.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/accessibility/Shape.java
@@ -13,11 +13,28 @@ package org.eclipse.swt.examples.accessibility;
import java.text.MessageFormat;
import java.util.ResourceBundle;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.accessibility.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.accessibility.ACC;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlAdapter;
+import org.eclipse.swt.accessibility.AccessibleControlEvent;
+import org.eclipse.swt.accessibility.AccessibleEvent;
+import org.eclipse.swt.events.FocusAdapter;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
/**
* Instances of this class represent an accessible, focusable, user interface object
@@ -47,6 +64,7 @@ public class Shape extends Canvas {
void addListeners() {
addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
GC gc = e.gc;
Display display = getDisplay();
@@ -91,6 +109,7 @@ public class Shape extends Canvas {
});
addTraverseListener(new TraverseListener() {
+ @Override
public void keyTraversed(TraverseEvent e) {
switch (e.detail) {
case SWT.TRAVERSE_TAB_NEXT:
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java
index 232304282b..77b85ae601 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/AddressBook.java
@@ -12,14 +12,34 @@ package org.eclipse.swt.examples.addressbook;
/* Imports */
-import java.io.*;
-import java.util.*;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.ResourceBundle;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
/**
* AddressBookExample is an example that uses <code>org.eclipse.swt</code>
@@ -76,6 +96,7 @@ public Shell open(Display display) {
searchDialog.setSearchAreaNames(columnNames);
searchDialog.setSearchAreaLabel(resAddressBook.getString("Column"));
searchDialog.addFindListener(new FindListener () {
+ @Override
public boolean find() {
return findEntry();
}
@@ -895,6 +916,7 @@ private class RowComparator implements Comparator<String[]> {
* @return negative if row1 less than row2, positive if
* row1 greater than row2, and zero if equal.
*/
+ @Override
public int compare(String[] row1, String[] row2) {
return row1[column].compareTo(row2[column]);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java
index a48ccb4a7d..03fd4e10e1 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/DataEntryDialog.java
@@ -12,12 +12,22 @@ package org.eclipse.swt.examples.addressbook;
/* Imports */
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
import java.util.ResourceBundle;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
/**
* DataEntryDialog class uses <code>org.eclipse.swt</code>
* libraries to implement a dialog that accepts basic personal information that
@@ -39,6 +49,7 @@ public DataEntryDialog(Shell parent) {
private void addTextListener(final Text text) {
text.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e){
Integer index = (Integer)(text.getData("index"));
values[index.intValue()] = text.getText();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java
index 22b4ab873d..df9936376c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/addressbook/SearchDialog.java
@@ -12,12 +12,27 @@ package org.eclipse.swt.examples.addressbook;
/* Imports */
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
import java.util.ResourceBundle;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+
/**
* SearchDialog is a simple class that uses <code>org.eclipse.swt</code>
* libraries to implement a basic search dialog.
@@ -65,6 +80,7 @@ public SearchDialog(Shell parent) {
gridData.widthHint = 200;
searchText.setLayoutData(gridData);
searchText.addModifyListener(new ModifyListener() {
+ @Override
public void modifyText(ModifyEvent e) {
boolean enableFind = (searchText.getCharCount() != 0);
findButton.setEnabled(enableFind);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java
index e51b601571..ed158c0662 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/browserexample/BrowserExample.java
@@ -10,14 +10,46 @@
*******************************************************************************/
package org.eclipse.swt.examples.browserexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.browser.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
-import java.io.*;
-import java.util.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.CloseWindowListener;
+import org.eclipse.swt.browser.LocationEvent;
+import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.browser.OpenWindowListener;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.browser.StatusTextEvent;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.swt.browser.TitleEvent;
+import org.eclipse.swt.browser.TitleListener;
+import org.eclipse.swt.browser.VisibilityWindowListener;
+import org.eclipse.swt.browser.WindowEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
public class BrowserExample {
static ResourceBundle resourceBundle = ResourceBundle.getBundle("examples_browser");
@@ -59,6 +91,7 @@ public class BrowserExample {
final Display display = parent.getDisplay();
browser.setData("org.eclipse.swt.examples.browserexample.BrowserApplication", this);
browser.addOpenWindowListener(new OpenWindowListener() {
+ @Override
public void open(WindowEvent event) {
Shell shell = new Shell(display);
if (icon != null) shell.setImage(icon);
@@ -73,8 +106,10 @@ public class BrowserExample {
show(false, null, null, true, true, true, true);
} else {
browser.addVisibilityWindowListener(new VisibilityWindowListener() {
+ @Override
public void hide(WindowEvent e) {
}
+ @Override
public void show(WindowEvent e) {
Browser browser = (Browser)e.widget;
BrowserExample app = (BrowserExample)browser.getData("org.eclipse.swt.examples.browserexample.BrowserApplication");
@@ -82,6 +117,7 @@ public class BrowserExample {
}
});
browser.addCloseWindowListener(new CloseWindowListener() {
+ @Override
public void close(WindowEvent event) {
Browser browser = (Browser)event.widget;
Shell shell = browser.getShell();
@@ -149,6 +185,7 @@ public class BrowserExample {
itemBack.setEnabled(browser.isBackEnabled());
itemForward.setEnabled(browser.isForwardEnabled());
Listener listener = new Listener() {
+ @Override
public void handleEvent(Event event) {
ToolItem item = (ToolItem)event.widget;
if (item == itemBack) browser.back();
@@ -174,12 +211,14 @@ public class BrowserExample {
final Rectangle rect = images[0].getBounds();
canvas.addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event e) {
Point pt = ((Canvas)e.widget).getSize();
e.gc.drawImage(images[index], 0, 0, rect.width, rect.height, 0, 0, pt.x, pt.y);
}
});
canvas.addListener(SWT.MouseDown, new Listener() {
+ @Override
public void handleEvent(Event e) {
browser.setUrl(getResourceString("Startup"));
}
@@ -187,6 +226,7 @@ public class BrowserExample {
final Display display = parent.getDisplay();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
if (canvas.isDisposed()) return;
if (busy) {
@@ -212,6 +252,7 @@ public class BrowserExample {
}
locationBar.setLayoutData(data);
locationBar.addListener(SWT.DefaultSelection, new Listener() {
+ @Override
public void handleEvent(Event e) {
browser.setUrl(locationBar.getText());
}
@@ -233,6 +274,7 @@ public class BrowserExample {
progressBar.setLayoutData(data);
browser.addStatusTextListener(new StatusTextListener() {
+ @Override
public void changed(StatusTextEvent event) {
status.setText(event.text);
}
@@ -250,6 +292,7 @@ public class BrowserExample {
if (statusBar || toolBar) {
browser.addProgressListener(new ProgressListener() {
+ @Override
public void changed(ProgressEvent event) {
if (event.total == 0) return;
int ratio = event.current * 100 / event.total;
@@ -260,6 +303,7 @@ public class BrowserExample {
if (canvas != null) canvas.redraw();
}
}
+ @Override
public void completed(ProgressEvent event) {
if (progressBar != null) progressBar.setSelection(0);
busy = false;
@@ -274,16 +318,19 @@ public class BrowserExample {
}
if (addressBar || statusBar || toolBar) {
browser.addLocationListener(new LocationListener() {
+ @Override
public void changed(LocationEvent event) {
busy = true;
if (event.top && locationBar != null) locationBar.setText(event.location);
}
+ @Override
public void changing(LocationEvent event) {
}
});
}
if (title) {
browser.addTitleListener(new TitleListener() {
+ @Override
public void changed(TitleEvent event) {
shell.setText(event.title+" - "+getResourceString("window.title"));
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
index 4f8059fce3..695c4b705a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/clipboard/ClipboardExample.java
@@ -10,13 +10,43 @@
*******************************************************************************/
package org.eclipse.swt.examples.clipboard;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.dnd.Clipboard;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.HTMLTransfer;
+import org.eclipse.swt.dnd.ImageTransfer;
+import org.eclipse.swt.dnd.RTFTransfer;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.DirectoryDialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
public class ClipboardExample {
@@ -372,6 +402,7 @@ void createImageTransfer(Composite copyParent, Composite pasteParent){
final ScrollBar copyHBar = copyImageCanvas.getHorizontalBar();
copyHBar.setEnabled(false);
copyHBar.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
if (copyImage[0] != null) {
int hSelection = copyHBar.getSelection();
@@ -385,6 +416,7 @@ void createImageTransfer(Composite copyParent, Composite pasteParent){
final ScrollBar copyVBar = copyImageCanvas.getVerticalBar();
copyVBar.setEnabled(false);
copyVBar.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent (Event e) {
if (copyImage[0] != null) {
int vSelection = copyVBar.getSelection();
@@ -396,6 +428,7 @@ void createImageTransfer(Composite copyParent, Composite pasteParent){
}
});
copyImageCanvas.addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event e) {
if(copyImage[0] != null) {
GC gc = e.gc;
@@ -470,6 +503,7 @@ void createImageTransfer(Composite copyParent, Composite pasteParent){
final ScrollBar pasteHBar = pasteImageCanvas.getHorizontalBar();
pasteHBar.setEnabled(false);
pasteHBar.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
if (pasteImage[0] != null) {
int hSelection = pasteHBar.getSelection();
@@ -483,6 +517,7 @@ void createImageTransfer(Composite copyParent, Composite pasteParent){
final ScrollBar pasteVBar = pasteImageCanvas.getVerticalBar();
pasteVBar.setEnabled(false);
pasteVBar.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event e) {
if (pasteImage[0] != null) {
int vSelection = pasteVBar.getSelection();
@@ -494,6 +529,7 @@ void createImageTransfer(Composite copyParent, Composite pasteParent){
}
});
pasteImageCanvas.addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event e) {
if(pasteImage[0] != null) {
GC gc = e.gc;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java
index f76fcf0c4a..578576a846 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/BrowserTab.java
@@ -16,11 +16,37 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
-import org.eclipse.swt.*;
-import org.eclipse.swt.browser.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.browser.AuthenticationEvent;
+import org.eclipse.swt.browser.AuthenticationListener;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.browser.CloseWindowListener;
+import org.eclipse.swt.browser.LocationEvent;
+import org.eclipse.swt.browser.LocationListener;
+import org.eclipse.swt.browser.OpenWindowListener;
+import org.eclipse.swt.browser.ProgressEvent;
+import org.eclipse.swt.browser.ProgressListener;
+import org.eclipse.swt.browser.StatusTextEvent;
+import org.eclipse.swt.browser.StatusTextListener;
+import org.eclipse.swt.browser.TitleEvent;
+import org.eclipse.swt.browser.TitleListener;
+import org.eclipse.swt.browser.VisibilityWindowListener;
+import org.eclipse.swt.browser.WindowEvent;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Widget;
class BrowserTab extends Tab {
@@ -154,6 +180,7 @@ class BrowserTab extends Tab {
mozillaButton = new Button (styleGroup, SWT.CHECK);
mozillaButton.setText ("SWT.MOZILLA");
mozillaButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
webKitButton.setSelection(false);
}
@@ -161,6 +188,7 @@ class BrowserTab extends Tab {
webKitButton = new Button (styleGroup, SWT.CHECK);
webKitButton.setText ("SWT.WEBKIT");
webKitButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
mozillaButton.setSelection(false);
}
@@ -290,6 +318,7 @@ class BrowserTab extends Tab {
if (browser == null) return;
if (eventName == "AuthenticationListener") {
browser.addAuthenticationListener(new AuthenticationListener () {
+ @Override
public void authenticate(AuthenticationEvent event) {
log (eventName, event);
}
@@ -297,6 +326,7 @@ class BrowserTab extends Tab {
}
if (eventName == "CloseWindowListener") {
browser.addCloseWindowListener (new CloseWindowListener () {
+ @Override
public void close(WindowEvent event) {
log (eventName, event);
}
@@ -304,9 +334,11 @@ class BrowserTab extends Tab {
}
if (eventName == "LocationListener") {
browser.addLocationListener (new LocationListener () {
+ @Override
public void changed(LocationEvent event) {
log (eventName + ".changed", event);
}
+ @Override
public void changing(LocationEvent event) {
log (eventName + ".changing", event);
}
@@ -314,6 +346,7 @@ class BrowserTab extends Tab {
}
if (eventName == "OpenWindowListener") {
browser.addOpenWindowListener (new OpenWindowListener () {
+ @Override
public void open(WindowEvent event) {
log (eventName, event);
}
@@ -321,9 +354,11 @@ class BrowserTab extends Tab {
}
if (eventName == "ProgressListener") {
browser.addProgressListener (new ProgressListener () {
+ @Override
public void changed(ProgressEvent event) {
log (eventName + ".changed", event);
}
+ @Override
public void completed(ProgressEvent event) {
log (eventName + ".completed", event);
}
@@ -331,6 +366,7 @@ class BrowserTab extends Tab {
}
if (eventName == "StatusTextListener") {
browser.addStatusTextListener (new StatusTextListener () {
+ @Override
public void changed(StatusTextEvent event) {
log (eventName, event);
}
@@ -338,6 +374,7 @@ class BrowserTab extends Tab {
}
if (eventName == "TitleListener") {
browser.addTitleListener (new TitleListener () {
+ @Override
public void changed(TitleEvent event) {
log (eventName, event);
}
@@ -345,9 +382,11 @@ class BrowserTab extends Tab {
}
if (eventName == "VisibilityWindowListener") {
browser.addVisibilityWindowListener (new VisibilityWindowListener () {
+ @Override
public void hide(WindowEvent event) {
log (eventName + ".hide", event);
}
+ @Override
public void show(WindowEvent event) {
log (eventName + ".show", event);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java
index 6e9cde6f73..c4c15d71e9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CTabFolderTab.java
@@ -11,12 +11,32 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CTabFolder;
+import org.eclipse.swt.custom.CTabFolder2Listener;
+import org.eclipse.swt.custom.CTabFolderEvent;
+import org.eclipse.swt.custom.CTabItem;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Widget;
class CTabFolderTab extends Tab {
int lastSelectedTab = 0;
@@ -68,6 +88,7 @@ class CTabFolderTab extends Tab {
item.setText(ControlExample.getResourceString ("Item_Font"));
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent event) {
if (selectionBackgroundColor != null) selectionBackgroundColor.dispose();
if (selectionForegroundColor != null) selectionForegroundColor.dispose();
@@ -249,6 +270,7 @@ class CTabFolderTab extends Tab {
item.setControl(text);
}
tabFolder1.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
lastSelectedTab = tabFolder1.getSelectionIndex();
}
@@ -335,18 +357,23 @@ class CTabFolderTab extends Tab {
void hookCustomListener (final String eventName) {
if (eventName == "CTabFolderEvent") {
tabFolder1.addCTabFolder2Listener (new CTabFolder2Listener () {
+ @Override
public void close (CTabFolderEvent event) {
log (eventName, event);
}
+ @Override
public void minimize(CTabFolderEvent event) {
log (eventName, event);
}
+ @Override
public void maximize(CTabFolderEvent event) {
log (eventName, event);
}
+ @Override
public void restore(CTabFolderEvent event) {
log (eventName, event);
}
+ @Override
public void showList(CTabFolderEvent event) {
log (eventName, event);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java
index 7df3b7cc8a..b48df055a2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CanvasTab.java
@@ -11,11 +11,28 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Caret;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Widget;
class CanvasTab extends Tab {
static final int colors [] = {
@@ -113,6 +130,7 @@ class CanvasTab extends Tab {
paintCount = 0; cx = 0; cy = 0;
canvas = new Canvas (canvasGroup, style);
canvas.addPaintListener(new PaintListener () {
+ @Override
public void paintControl(PaintEvent e) {
paintCount++;
GC gc = e.gc;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
index c4245a4fff..5d87e29e94 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/CoolBarTab.java
@@ -11,11 +11,30 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Widget;
class CoolBarTab extends Tab {
/* Example widgets and group that contains them */
@@ -213,6 +232,7 @@ class CoolBarTab extends Tab {
/* Add a listener to resize the group box to match the coolbar */
coolBar.addListener(SWT.Resize, new Listener() {
+ @Override
public void handleEvent(Event event) {
exampleGroup.layout();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java
index 29496ef203..bbe03a9bcc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/MenuTab.java
@@ -11,10 +11,19 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
class MenuTab extends Tab {
/* Widgets added to the "Menu Style", "MenuItem Style" and "Other" groups */
@@ -109,6 +118,7 @@ class MenuTab extends Tab {
shell.setSize (300, 100);
shell.setText (ControlExample.getResourceString("Title") + shellCount);
shell.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
e.gc.drawString(ControlExample.getResourceString("PopupMenuHere"), 20, 20);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java
index 0bcf777db8..419201b1bd 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ShellTab.java
@@ -11,10 +11,19 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Widget;
class ShellTab extends Tab {
/* Style widgets added to the "Style" groups, and "Other" group */
@@ -104,6 +113,7 @@ class ShellTab extends Tab {
close.setBounds(160, 20, 120, 30);
close.setText(ControlExample.getResourceString("Close"));
close.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
currentShell.dispose();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java
index 87d5d16b8b..c966dfcb92 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/StyledTextTab.java
@@ -11,14 +11,49 @@
package org.eclipse.swt.examples.controlexample;
-import java.io.*;
+import java.io.IOException;
+import java.io.InputStream;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.BidiSegmentEvent;
+import org.eclipse.swt.custom.BidiSegmentListener;
+import org.eclipse.swt.custom.ExtendedModifyEvent;
+import org.eclipse.swt.custom.ExtendedModifyListener;
+import org.eclipse.swt.custom.LineBackgroundEvent;
+import org.eclipse.swt.custom.LineBackgroundListener;
+import org.eclipse.swt.custom.LineStyleEvent;
+import org.eclipse.swt.custom.LineStyleListener;
+import org.eclipse.swt.custom.MovementEvent;
+import org.eclipse.swt.custom.MovementListener;
+import org.eclipse.swt.custom.PaintObjectEvent;
+import org.eclipse.swt.custom.PaintObjectListener;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.TextChangeListener;
+import org.eclipse.swt.custom.TextChangedEvent;
+import org.eclipse.swt.custom.TextChangingEvent;
+import org.eclipse.swt.custom.VerifyKeyListener;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Widget;
class StyledTextTab extends ScrollableTab {
/* Example widgets and groups that contain them */
@@ -252,6 +287,7 @@ class StyledTextTab extends ScrollableTab {
redButton.addSelectionListener(colorListener);
yellowButton.addSelectionListener(colorListener);
yellowButton.addDisposeListener(new DisposeListener () {
+ @Override
public void widgetDisposed (DisposeEvent e) {
boldImage.dispose();
italicImage.dispose();
@@ -348,6 +384,7 @@ class StyledTextTab extends ScrollableTab {
void hookCustomListener (final String eventName) {
if (eventName == "ExtendedModifyListener") {
styledText.addExtendedModifyListener (new ExtendedModifyListener() {
+ @Override
public void modifyText(ExtendedModifyEvent event) {
log (eventName, event);
}
@@ -355,6 +392,7 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "BidiSegmentListener") {
styledText.addBidiSegmentListener (new BidiSegmentListener() {
+ @Override
public void lineGetSegments(BidiSegmentEvent event) {
log (eventName, event);
}
@@ -362,6 +400,7 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "LineBackgroundListener") {
styledText.addLineBackgroundListener (new LineBackgroundListener() {
+ @Override
public void lineGetBackground(LineBackgroundEvent event) {
log (eventName, event);
}
@@ -369,6 +408,7 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "LineStyleListener") {
styledText.addLineStyleListener (new LineStyleListener() {
+ @Override
public void lineGetStyle(LineStyleEvent event) {
log (eventName, event);
}
@@ -376,6 +416,7 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "PaintObjectListener") {
styledText.addPaintObjectListener (new PaintObjectListener() {
+ @Override
public void paintObject(PaintObjectEvent event) {
log (eventName, event);
}
@@ -383,12 +424,15 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "TextChangeListener") {
styledText.getContent().addTextChangeListener (new TextChangeListener() {
+ @Override
public void textChanged(TextChangedEvent event) {
log (eventName + ".textChanged", event);
}
+ @Override
public void textChanging(TextChangingEvent event) {
log (eventName + ".textChanging", event);
}
+ @Override
public void textSet(TextChangedEvent event) {
log (eventName + ".textSet", event);
}
@@ -396,6 +440,7 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "VerifyKeyListener") {
styledText.addVerifyKeyListener (new VerifyKeyListener() {
+ @Override
public void verifyKey(VerifyEvent event) {
log (eventName, event);
}
@@ -403,9 +448,11 @@ class StyledTextTab extends ScrollableTab {
}
if (eventName == "WordMovementListener") {
styledText.addWordMovementListener (new MovementListener() {
+ @Override
public void getNextOffset(MovementEvent event) {
log (eventName + ".getNextOffset", event);
}
+ @Override
public void getPreviousOffset(MovementEvent event) {
log (eventName + ".getPreviousOffset", event);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
index b1ef0dc4b2..452fd1f310 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/Tab.java
@@ -11,13 +11,60 @@
package org.eclipse.swt.examples.controlexample;
-import java.lang.reflect.*;
+import java.lang.reflect.Method;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ArmEvent;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.FocusEvent;
+import org.eclipse.swt.events.HelpEvent;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.events.TypedEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FontDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Widget;
/**
* <code>Tab</code> is the abstract superclass of every page
@@ -384,6 +431,7 @@ abstract class Tab {
}
});
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent event) {
if (foregroundColor != null) foregroundColor.dispose();
if (backgroundColor != null) backgroundColor.dispose();
@@ -623,6 +671,7 @@ abstract class Tab {
if ((setFieldsMask & TEXT) != 0) textText.setText(setFieldsEvent.text);
textText.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
textText.addModifyListener(new ModifyListener () {
+ @Override
public void modifyText(ModifyEvent e) {
String newValue = textText.getText();
if (newValue.length() == 0) {
@@ -642,6 +691,7 @@ abstract class Tab {
if ((setFieldsMask & X) != 0) xText.setText(Integer.toString(setFieldsEvent.x));
xText.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
xText.addModifyListener(new ModifyListener () {
+ @Override
public void modifyText(ModifyEvent e) {
String newValue = xText.getText ();
try {
@@ -662,6 +712,7 @@ abstract class Tab {
if ((setFieldsMask & Y) != 0) yText.setText(Integer.toString(setFieldsEvent.y));
yText.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
yText.addModifyListener(new ModifyListener () {
+ @Override
public void modifyText(ModifyEvent e) {
String newValue = yText.getText ();
try {
@@ -682,6 +733,7 @@ abstract class Tab {
if ((setFieldsMask & WIDTH) != 0) widthText.setText(Integer.toString(setFieldsEvent.width));
widthText.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
widthText.addModifyListener(new ModifyListener () {
+ @Override
public void modifyText(ModifyEvent e) {
String newValue = widthText.getText ();
try {
@@ -702,6 +754,7 @@ abstract class Tab {
if ((setFieldsMask & HEIGHT) != 0) heightText.setText(Integer.toString(setFieldsEvent.height));
heightText.setLayoutData (new GridData (SWT.FILL, SWT.CENTER, true, false));
heightText.addModifyListener(new ModifyListener () {
+ @Override
public void modifyText(ModifyEvent e) {
String newValue = heightText.getText ();
try {
@@ -746,6 +799,7 @@ abstract class Tab {
MenuItem cut = new MenuItem (popup, SWT.PUSH);
cut.setText (ControlExample.getResourceString("MenuItem_Cut"));
cut.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
eventConsole.cut ();
}
@@ -753,6 +807,7 @@ abstract class Tab {
MenuItem copy = new MenuItem (popup, SWT.PUSH);
copy.setText (ControlExample.getResourceString("MenuItem_Copy"));
copy.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
eventConsole.copy ();
}
@@ -760,6 +815,7 @@ abstract class Tab {
MenuItem paste = new MenuItem (popup, SWT.PUSH);
paste.setText (ControlExample.getResourceString("MenuItem_Paste"));
paste.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
eventConsole.paste ();
}
@@ -768,6 +824,7 @@ abstract class Tab {
MenuItem selectAll = new MenuItem (popup, SWT.PUSH);
selectAll.setText(ControlExample.getResourceString("MenuItem_SelectAll"));
selectAll.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
eventConsole.selectAll ();
}
@@ -1059,6 +1116,7 @@ abstract class Tab {
dialog.setDefaultButton(setButton);
dialog.pack();
dialog.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
setGetDialog = null;
}
@@ -1326,6 +1384,7 @@ abstract class Tab {
Control[] controls = getExampleControls();
for (final Control control : controls) {
control.addListener(SWT.MenuDetect, new Listener() {
+ @Override
public void handleEvent(Event event) {
Menu menu = control.getMenu();
if (menu != null && samplePopup) {
@@ -1535,6 +1594,7 @@ abstract class Tab {
void hookListeners (Widget widget) {
if (logging) {
Listener listener = new Listener() {
+ @Override
public void handleEvent (Event event) {
log (event);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
index 3edb234868..49049a5e15 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TableTab.java
@@ -11,11 +11,30 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Widget;
class TableTab extends ScrollableTab {
/* Example widgets and groups that contain them */
@@ -90,6 +109,7 @@ class TableTab extends ScrollableTab {
item.setText(ControlExample.getResourceString ("Cell_Font"));
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent event) {
if (itemBackgroundColor != null) itemBackgroundColor.dispose();
if (itemForegroundColor != null) itemForegroundColor.dispose();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolTipTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolTipTab.java
index 99bbffba19..ca92c86130 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolTipTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/ToolTipTab.java
@@ -11,10 +11,23 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.ToolTip;
+import org.eclipse.swt.widgets.Tray;
+import org.eclipse.swt.widgets.TrayItem;
+import org.eclipse.swt.widgets.Widget;
class ToolTipTab extends Tab {
@@ -160,6 +173,7 @@ class ToolTipTab extends Tab {
}
});
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent event) {
disposeTrayItem();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
index c4b8ca350d..86b9417e78 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/controlexample/TreeTab.java
@@ -11,11 +11,31 @@
package org.eclipse.swt.examples.controlexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.events.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.Widget;
class TreeTab extends ScrollableTab {
/* Example widgets and groups that contain them */
@@ -91,6 +111,7 @@ class TreeTab extends ScrollableTab {
item.setText(ControlExample.getResourceString ("Cell_Font"));
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent event) {
if (itemBackgroundColor != null) itemBackgroundColor.dispose();
if (itemForegroundColor != null) itemForegroundColor.dispose();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
index 22ff2c7245..ad25c4aff2 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/dnd/DNDExample.java
@@ -11,15 +11,61 @@
package org.eclipse.swt.examples.dnd;
-import java.net.*;
+import java.net.MalformedURLException;
+import java.net.URL;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.custom.ScrolledComposite;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.DropTargetListener;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.HTMLTransfer;
+import org.eclipse.swt.dnd.RTFTransfer;
+import org.eclipse.swt.dnd.TextTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.dnd.URLTransfer;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.FontMetrics;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeColumn;
+import org.eclipse.swt.widgets.TreeItem;
public class DNDExample {
@@ -170,6 +216,7 @@ private void createDragSource() {
dragSource = new DragSource(dragControl, dragOperation);
dragSource.setTransfer(dragTypes);
dragSource.addDragListener(new DragSourceListener() {
+ @Override
public void dragFinished(org.eclipse.swt.dnd.DragSourceEvent event) {
dragConsole.append(">>dragFinished\n");
printEvent(event);
@@ -234,6 +281,7 @@ private void createDragSource() {
}
}
}
+ @Override
public void dragSetData(org.eclipse.swt.dnd.DragSourceEvent event) {
dragConsole.append(">>dragSetData\n");
printEvent(event);
@@ -253,6 +301,7 @@ private void createDragSource() {
event.data = dragDataFiles;
}
}
+ @Override
public void dragStart(org.eclipse.swt.dnd.DragSourceEvent event) {
dragConsole.append(">>dragStart\n");
printEvent(event);
@@ -744,6 +793,7 @@ private void createDropTarget() {
dropTarget = new DropTarget(dropControl, dropOperation);
dropTarget.setTransfer(dropTypes);
dropTarget.addDropListener(new DropTargetListener() {
+ @Override
public void dragEnter(DropTargetEvent event) {
dropConsole.append(">>dragEnter\n");
printEvent(event);
@@ -752,10 +802,12 @@ private void createDropTarget() {
}
event.feedback = dropFeedback;
}
+ @Override
public void dragLeave(DropTargetEvent event) {
dropConsole.append(">>dragLeave\n");
printEvent(event);
}
+ @Override
public void dragOperationChanged(DropTargetEvent event) {
dropConsole.append(">>dragOperationChanged\n");
printEvent(event);
@@ -764,11 +816,13 @@ private void createDropTarget() {
}
event.feedback = dropFeedback;
}
+ @Override
public void dragOver(DropTargetEvent event) {
dropConsole.append(">>dragOver\n");
printEvent(event);
event.feedback = dropFeedback;
}
+ @Override
public void drop(DropTargetEvent event) {
dropConsole.append(">>drop\n");
printEvent(event);
@@ -885,6 +939,7 @@ private void createDropTarget() {
throw new SWTError(SWT.ERROR_NOT_IMPLEMENTED);
}
}
+ @Override
public void dropAccept(DropTargetEvent event) {
dropConsole.append(">>dropAccept\n");
printEvent(event);
@@ -1192,6 +1247,7 @@ private Control createWidget(int type, Composite parent, String prefix){
Canvas canvas = new Canvas(parent, SWT.BORDER);
canvas.setData("STRINGS", new String[] {prefix+" Canvas widget"});
canvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent e) {
Canvas c = (Canvas)e.widget;
Image image = (Image)c.getData("IMAGE");
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
index a50c554939..6c7cb3cb55 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/fileviewer/FileViewer.java
@@ -11,18 +11,59 @@
package org.eclipse.swt.examples.fileviewer;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.dnd.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.program.*;
-import org.eclipse.swt.widgets.*;
-
-import java.io.*;
-import java.text.*;
-import java.util.*;
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.text.DateFormat;
+import java.text.MessageFormat;
+import java.util.Date;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.Vector;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.dnd.DND;
+import org.eclipse.swt.dnd.DragSource;
+import org.eclipse.swt.dnd.DragSourceEvent;
+import org.eclipse.swt.dnd.DragSourceListener;
+import org.eclipse.swt.dnd.DropTarget;
+import org.eclipse.swt.dnd.DropTargetAdapter;
+import org.eclipse.swt.dnd.DropTargetEvent;
+import org.eclipse.swt.dnd.FileTransfer;
+import org.eclipse.swt.dnd.Transfer;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.events.TreeAdapter;
+import org.eclipse.swt.events.TreeEvent;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.program.Program;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
/**
* File Viewer example
@@ -404,6 +445,7 @@ public class FileViewer {
tree.setLayoutData(new GridData(GridData.FILL_HORIZONTAL | GridData.FILL_VERTICAL));
tree.addSelectionListener(new SelectionListener() {
+ @Override
public void widgetSelected(SelectionEvent event) {
final TreeItem[] selection = tree.getSelection();
if (selection != null && selection.length != 0) {
@@ -413,6 +455,7 @@ public class FileViewer {
notifySelectedDirectory(file);
}
}
+ @Override
public void widgetDefaultSelected(SelectionEvent event) {
final TreeItem[] selection = tree.getSelection();
if (selection != null && selection.length != 0) {
@@ -452,6 +495,7 @@ public class FileViewer {
dragSource.addDragListener(new DragSourceListener() {
TreeItem[] dndSelection = null;
String[] sourceNames = null;
+ @Override
public void dragStart(DragSourceEvent event){
dndSelection = tree.getSelection();
sourceNames = null;
@@ -459,6 +503,7 @@ public class FileViewer {
isDragging = true;
processedDropFiles = null;
}
+ @Override
public void dragFinished(DragSourceEvent event){
dragSourceHandleDragFinished(event, sourceNames);
dndSelection = null;
@@ -467,6 +512,7 @@ public class FileViewer {
processedDropFiles = null;
handleDeferredRefresh();
}
+ @Override
public void dragSetData(DragSourceEvent event){
if (dndSelection == null || dndSelection.length == 0) return;
if (! FileTransfer.getInstance().isSupportedType(event.dataType)) return;
@@ -760,12 +806,14 @@ public class FileViewer {
dragSource.addDragListener(new DragSourceListener() {
TableItem[] dndSelection = null;
String[] sourceNames = null;
+ @Override
public void dragStart(DragSourceEvent event){
dndSelection = table.getSelection();
sourceNames = null;
event.doit = dndSelection.length > 0;
isDragging = true;
}
+ @Override
public void dragFinished(DragSourceEvent event){
dragSourceHandleDragFinished(event, sourceNames);
dndSelection = null;
@@ -773,6 +821,7 @@ public class FileViewer {
isDragging = false;
handleDeferredRefresh();
}
+ @Override
public void dragSetData(DragSourceEvent event){
if (dndSelection == null || dndSelection.length == 0) return;
if (! FileTransfer.getInstance().isSupportedType(event.dataType)) return;
@@ -1503,6 +1552,7 @@ public class FileViewer {
* Manages the worker's thread
*/
private final Runnable workerRunnable = new Runnable() {
+ @Override
public void run() {
while (! workerStopped) {
synchronized(workerLock) {
@@ -1531,6 +1581,7 @@ public class FileViewer {
File[] dirList;
// Clear existing information
display.syncExec(new Runnable() {
+ @Override
public void run() {
tableContentsOfLabel.setText(FileViewer.getResourceString("details.ContentsOf.text",
new Object[] { workerStateDir.getPath() }));
@@ -1583,6 +1634,7 @@ public class FileViewer {
final String[] strings = new String[] { nameString, sizeString, typeString, dateString };
display.syncExec(new Runnable() {
+ @Override
public void run () {
// guard against the shell being closed before this runs
if (shell.isDisposed()) return;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java
index 07cbffb884..f20d3295a3 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AdvancedGraphics.java
@@ -16,12 +16,25 @@ package org.eclipse.swt.examples.graphics;
* For a list of all SWT example snippets see
* http://www.eclipse.org/swt/snippets/
*/
-import java.io.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ResourceBundle;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
public class AdvancedGraphics {
@@ -61,6 +74,7 @@ public class AdvancedGraphics {
final Image image = loadImage(display, AdvancedGraphics.class, "irmaos.jpg");
final Rectangle rect = image.getBounds();
shell.addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event event) {
GC gc = event.gc;
Transform tr = new Transform(display);
@@ -84,6 +98,7 @@ public class AdvancedGraphics {
shell.setSize(shell.computeSize(rect.width, rect.height));
shell.open();
shell.addListener(SWT.Dispose, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (image != null) image.dispose();
font.dispose();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java
index f98fe4a96a..7746efa3eb 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/AnimatedGraphicsTab.java
@@ -11,9 +11,17 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
/**
* This class extends the GraphicsTab class to create animated graphics.
@@ -57,6 +65,7 @@ public abstract class AnimatedGraphicsTab extends GraphicsTab {
toolBar = new ToolBar(parent, SWT.FLAT);
Listener toolBarListener = new Listener() {
+ @Override
public void handleEvent(Event event) {
switch (event.type) {
case SWT.Selection: {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java
index da28aef167..3f93db0e69 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ColorMenu.java
@@ -11,11 +11,21 @@
package org.eclipse.swt.examples.graphics;
-import java.util.*;
+import java.util.ArrayList;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
/**
* This class utilizes the factory design pattern to create menus that may
@@ -279,6 +289,7 @@ public class ColorMenu {
return resources;
}
+ @Override
public void handleEvent(Event event) {
switch (event.type) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CountDownTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CountDownTab.java
index 03ab7cfcfc..02f387d2e6 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CountDownTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CountDownTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Spinner;
/**
* This tab presents a count down from 5 to 1, then displays SWT.
@@ -59,6 +69,7 @@ public class CountDownTab extends AnimatedGraphicsTab {
// add selection listener to reset nextNumber after
// the sequence has completed
playItem.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (nextNumber < 1)
nextNumber = startNumber;
@@ -78,6 +89,7 @@ public class CountDownTab extends AnimatedGraphicsTab {
lineWidthSpinner.setMinimum(1);
lineWidthSpinner.setMaximum(100);
lineWidthSpinner.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (!pauseItem.isEnabled()) {
example.redraw();
@@ -97,6 +109,7 @@ public class CountDownTab extends AnimatedGraphicsTab {
aliasCombo.select(0);
antialias = aliasValues[0];
aliasCombo.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
antialias = aliasValues[aliasCombo.getSelectionIndex()];
if (!pauseItem.isEnabled()) {
@@ -117,6 +130,7 @@ public class CountDownTab extends AnimatedGraphicsTab {
lineCapCombo.select(0);
lineCap = capValues[0];
lineCapCombo.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
lineCap = capValues[lineCapCombo.getSelectionIndex()];
if (!pauseItem.isEnabled()) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesSWTTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesSWTTab.java
index 8ef946662d..d60694d353 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesSWTTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesSWTTab.java
@@ -11,10 +11,18 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.widgets.Composite;
/**
* This tab presents cubic and quadratic curves that can be drawn. As a
@@ -133,6 +141,7 @@ public void createControlPanel(Composite parent) {
mouseMoveListener = new MouseMoveListener() {
+ @Override
public void mouseMove(MouseEvent e) {
if (hovering && mouseDown) {
example.canvas.setCursor(cursor);
@@ -191,6 +200,7 @@ public void createControlPanel(Composite parent) {
mouseListener = new MouseListener() {
+ @Override
public void mouseDoubleClick(MouseEvent e) {}
/**
@@ -198,6 +208,7 @@ public void createControlPanel(Composite parent) {
*
* @param e an event containing information about the mouse button press
*/
+ @Override
public void mouseDown(MouseEvent e) {
Rectangle r1 = new Rectangle(sRect1.x + (int)sXPos - 1, sRect1.y + (int)sYPos - 1, sRect1.width+2, sRect1.height+2);
Rectangle r2 = new Rectangle(sRect2.x + (int)sXPos - 1, sRect2.y + (int)sYPos - 1, sRect2.width+2, sRect2.height+2);
@@ -240,6 +251,7 @@ public void createControlPanel(Composite parent) {
*
* @param e an event containing information about the mouse button release
*/
+ @Override
public void mouseUp(MouseEvent e) {
mouseDown = false;
if (isHovering(e)) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesTab.java
index 3d45c89dd9..6b2352c938 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CurvesTab.java
@@ -11,10 +11,18 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseListener;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.widgets.Composite;
/**
* This tab presents cubic and quadratic curves that can be drawn.
@@ -118,6 +126,7 @@ public void createControlPanel(Composite parent) {
mouseMoveListener = new MouseMoveListener() {
+ @Override
public void mouseMove(MouseEvent e) {
if (hovering && mouseDown) {
example.canvas.setCursor(cursor);
@@ -161,6 +170,7 @@ public void createControlPanel(Composite parent) {
mouseListener = new MouseListener() {
+ @Override
public void mouseDoubleClick(MouseEvent e) {}
/**
@@ -168,6 +178,7 @@ public void createControlPanel(Composite parent) {
*
* @param e an event containing information about the mouse button press
*/
+ @Override
public void mouseDown(MouseEvent e) {
Rectangle quad = new Rectangle(quadHndl.x + (int)quadXPos - 1, quadHndl.y + (int)quadYPos - 1, quadHndl.width+2, quadHndl.height+2);
Rectangle quadEnd = new Rectangle(quadEndHndl.x + (int)quadXPos - 1, quadEndHndl.y + (int)quadYPos - 1, quadEndHndl.width+2, quadEndHndl.height+2);
@@ -198,6 +209,7 @@ public void createControlPanel(Composite parent) {
*
* @param e an event containing information about the mouse button release
*/
+ @Override
public void mouseUp(MouseEvent e) {
mouseDown = false;
if (isHovering(e)) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java
index c266a4dfb3..d0cca251ec 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomAlphaTab.java
@@ -11,10 +11,22 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Spinner;
/**
* This tab demonstrates the use of alpha blending. It allows a user to specify
@@ -75,6 +87,7 @@ public void createControlPanel(Composite parent) {
alphaSpinner.setMaximum(255);
alphaSpinner.setSelection(127);
alphaSpinner.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -84,6 +97,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
background = gb;
colorButton.setImage(gb.getThumbNail());
@@ -103,6 +117,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(background.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomFontTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomFontTab.java
index 3c7ee92aa9..de5c32ad3c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomFontTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/CustomFontTab.java
@@ -11,12 +11,27 @@
package org.eclipse.swt.examples.graphics;
-import java.util.*;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import java.util.ArrayList;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Spinner;
/**
* This tab demonstrates various text fonts. It allows the user to specify font
@@ -100,6 +115,7 @@ public void createControlPanel(Composite parent) {
}
fontFaceCb.select(0);
fontFaceCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent (Event event) {
example.redraw();
}
@@ -116,6 +132,7 @@ public void createControlPanel(Composite parent) {
}
fontStyleCb.select(0);
fontStyleCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent (Event event) {
example.redraw();
}
@@ -131,6 +148,7 @@ public void createControlPanel(Composite parent) {
fontPointSpinner.setMaximum(1000);
fontPointSpinner.setSelection(200);
fontPointSpinner.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -140,6 +158,7 @@ public void createControlPanel(Composite parent) {
cm.setColorItems(true);
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
fontForeground = gb;
colorButton.setImage(gb.getThumbNail());
@@ -158,6 +177,7 @@ public void createControlPanel(Composite parent) {
colorButton.setText(GraphicsExample.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(fontForeground.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
index 225a4e4372..6babecd782 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientDialog.java
@@ -11,12 +11,28 @@
package org.eclipse.swt.examples.graphics;
-import java.util.*;
+import java.util.ArrayList;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Shell;
/**
* This dialog is used for prompting the user to select two colors for the
@@ -65,6 +81,7 @@ public class GradientDialog extends Dialog {
createDialogControls(dialog);
dialog.addListener(SWT.Close, new Listener() {
+ @Override
public void handleEvent(Event event) {
for (int i = 0; i < resources.size(); i++) {
Object obj = resources.get(i);
@@ -129,6 +146,7 @@ public class GradientDialog extends Dialog {
gridData.heightHint = 100;
canvas.setLayoutData(gridData);
canvas.addListener (SWT.Paint, new Listener () {
+ @Override
public void handleEvent (Event e) {
Image preview = null;
Point size = canvas.getSize();
@@ -168,6 +186,7 @@ public class GradientDialog extends Dialog {
colorButton1.setImage(img1);
resources.add(img1);
menu1 = colorMenu.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
rgb1 = gb.getBgColor1().getRGB();
colorButton1.setImage(gb.getThumbNail());
@@ -175,6 +194,7 @@ public class GradientDialog extends Dialog {
}
});
colorButton1.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
@@ -194,6 +214,7 @@ public class GradientDialog extends Dialog {
colorButton2.setImage(img2);
resources.add(img2);
menu2 = colorMenu.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
rgb2 = gb.getBgColor1().getRGB();
colorButton2.setImage(gb.getThumbNail());
@@ -201,6 +222,7 @@ public class GradientDialog extends Dialog {
}
});
colorButton2.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
@@ -229,6 +251,7 @@ public class GradientDialog extends Dialog {
okButton = new Button (okCancelComp, SWT.PUSH);
okButton.setText("&OK");
okButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
returnVal = SWT.OK;
parent.close();
@@ -239,6 +262,7 @@ public class GradientDialog extends Dialog {
cancelButton = new Button (okCancelComp, SWT.PUSH);
cancelButton.setText("&Cancel");
cancelButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
parent.close();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientTab.java
index 86d8d8d2dc..0e9425368a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GradientTab.java
@@ -86,6 +86,7 @@ public void createControlPanel(final Composite parent) {
// menu for colorItem1
menu1 = colorMenu.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
colorGB1 = gb;
colorItem1.setImage(gb.getThumbNail());
@@ -101,6 +102,7 @@ public void createControlPanel(final Composite parent) {
colorItem1.setText(GraphicsExample.getResourceString("GradientTabItem1"));
colorItem1.setImage(colorGB1.getThumbNail());
colorItem1.addListener(SWT.Selection, new Listener(){
+ @Override
public void handleEvent(Event event) {
final ToolItem toolItem = (ToolItem) event.widget;
final ToolBar toolBar = toolItem.getParent();
@@ -113,6 +115,7 @@ public void createControlPanel(final Composite parent) {
// menu for colorItem2
menu2 = colorMenu.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
colorGB2 = gb;
colorItem2.setImage(gb.getThumbNail());
@@ -128,6 +131,7 @@ public void createControlPanel(final Composite parent) {
colorItem2.setText(GraphicsExample.getResourceString("GradientTabItem2"));
colorItem2.setImage(colorGB2.getThumbNail());
colorItem2.addListener(SWT.Selection, new Listener(){
+ @Override
public void handleEvent(Event event) {
final ToolItem toolItem = (ToolItem) event.widget;
final ToolBar toolBar = toolItem.getParent();
@@ -143,6 +147,7 @@ public void createControlPanel(final Composite parent) {
swapItem.setText(GraphicsExample.getResourceString("SwapColors")); //$NON-NLS-1$
swapItem.setImage(example.loadImage(display, "swap.gif"));
swapItem.addListener(SWT.Selection, new Listener(){
+ @Override
public void handleEvent(Event event) {
GraphicsBackground tmp = colorGB1;
colorGB1 = colorGB2;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java
index cc3232a250..aedb82013a 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicAntialiasTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates antialiasing for graphics. Antialiasing is used for
@@ -74,6 +84,7 @@ public void createControlPanel(Composite parent) {
aliasCombo.add("ON");
aliasCombo.select(0);
aliasCombo.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -82,6 +93,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setColorItems(true);
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
ovalColorGB = gb;
colorButton.setImage(gb.getThumbNail());
@@ -101,6 +113,7 @@ public void createControlPanel(Composite parent) {
colorButton.setText(GraphicsExample.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(ovalColorGB.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsExample.java
index d58cded724..dd2b44a958 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/GraphicsExample.java
@@ -10,13 +10,45 @@
*******************************************************************************/
package org.eclipse.swt.examples.graphics;
-import java.io.*;
-import java.util.*;
-
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.HashSet;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FormAttachment;
+import org.eclipse.swt.layout.FormData;
+import org.eclipse.swt.layout.FormLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
/**
* This class is the main class of the graphics application. Various "tabs" are
@@ -145,6 +177,7 @@ void createControls(final Composite parent) {
tabControlPanel.setLayoutData(data);
vSash.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
Rectangle rect = hSash.getParent().getClientArea();
event.x = Math.min (Math.max (event.x, 60), rect.width - 60);
@@ -159,6 +192,7 @@ void createControls(final Composite parent) {
}
});
hSash.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
Rectangle rect = vSash.getParent().getClientArea();
event.y = Math.min (Math.max (event.y, tabList.getLocation().y + 60), rect.height - 60);
@@ -176,6 +210,7 @@ void createCanvas(Composite parent) {
if (dbItem.getSelection()) style |= SWT.DOUBLE_BUFFERED;
canvas = new Canvas(parent, style);
canvas.addListener(SWT.Paint, new Listener() {
+ @Override
public void handleEvent(Event event) {
GC gc = event.gc;
Rectangle rect = canvas.getClientArea();
@@ -233,6 +268,7 @@ void createToolBar(final Composite parent) {
back.setImage(loadImage(display, "back.gif")); //$NON-NLS-1$
back.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
int index = tabs_in_order.indexOf(tab) - 1;
if (index < 0)
@@ -245,6 +281,7 @@ void createToolBar(final Composite parent) {
next.setText(getResourceString("Next")); //$NON-NLS-1$
next.setImage(loadImage(display, "next.gif")); //$NON-NLS-1$
next.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
int index = (tabs_in_order.indexOf(tab) + 1)%tabs_in_order.size();
setTab(tabs_in_order.get(index));
@@ -260,6 +297,7 @@ void createToolBar(final Composite parent) {
// create the background menu
backMenu = colorMenu.createMenu(parent, new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
background = gb;
backItem.setImage(gb.getThumbNail());
@@ -275,6 +313,7 @@ void createToolBar(final Composite parent) {
backItem.setText(getResourceString("Background")); //$NON-NLS-1$
backItem.setImage(background.getThumbNail());
backItem.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (event.widget == backItem) {
final ToolItem toolItem = (ToolItem) event.widget;
@@ -292,6 +331,7 @@ void createToolBar(final Composite parent) {
dbItem.setText(getResourceString("DoubleBuffer")); //$NON-NLS-1$
dbItem.setImage(loadImage(display, "db.gif")); //$NON-NLS-1$
dbItem.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
setDoubleBuffered(dbItem.getSelection());
}
@@ -370,6 +410,7 @@ static Image createImage(Device device, Color color) {
void createTabList(Composite parent) {
tabList = new Tree(parent, SWT.SINGLE | SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
Arrays.sort(tabs, new Comparator<GraphicsTab>() {
+ @Override
public int compare(GraphicsTab tab0, GraphicsTab tab1) {
return tab0.getText().compareTo(tab1.getText());
}
@@ -398,6 +439,7 @@ void createTabList(Composite parent) {
}
}
tabList.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
TreeItem item = (TreeItem)event.item;
if (item != null) {
@@ -539,6 +581,7 @@ public Shell open(final Display display) {
shell.setText(getResourceString("GraphicsExample")); //$NON-NLS-1$
final GraphicsExample example = new GraphicsExample(shell);
shell.addListener(SWT.Close, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.dispose();
}
@@ -610,6 +653,7 @@ public void setTab(GraphicsTab tab) {
void startAnimationTimer() {
final Display display = parent.getDisplay();
display.timerExec(TIMER, new Runnable() {
+ @Override
public void run() {
if (canvas.isDisposed()) return;
int timeout = TIMER;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java
index 8242e5af49..ce977a1f4b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/ImageTransformTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Spinner;
/**
* This tab demonstrates transformations, such as scaling, rotation, and
@@ -76,6 +86,7 @@ public void createControlPanel(Composite parent) {
rotateSpinner.setMaximum(720);
rotateSpinner.setIncrement(30);
rotateSpinner.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -93,6 +104,7 @@ public void createControlPanel(Composite parent) {
translateSpinnerX.setSelection(0);
translateSpinnerX.setIncrement(10);
translateSpinnerX.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -110,6 +122,7 @@ public void createControlPanel(Composite parent) {
translateSpinnerY.setSelection(0);
translateSpinnerY.setIncrement(10);
translateSpinnerY.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -128,6 +141,7 @@ public void createControlPanel(Composite parent) {
scaleSpinnerX.setSelection(100);
scaleSpinnerX.setIncrement(10);
scaleSpinnerX.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -146,6 +160,7 @@ public void createControlPanel(Composite parent) {
scaleSpinnerY.setSelection(100);
scaleSpinnerY.setIncrement(10);
scaleSpinnerY.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -157,6 +172,7 @@ public void createControlPanel(Composite parent) {
invertButton = new Button(comp, SWT.TOGGLE);
invertButton.setText(GraphicsExample.getResourceString("Invert")); //$NON-NLS-1$
invertButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java
index 4d2c592529..f756e1c8fa 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/InterpolationTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
/**
* This tab shows the effects of applying various interpolation algorithms to
@@ -64,6 +74,7 @@ public void createControlPanel(Composite parent) {
imageCb.add(GraphicsExample.getResourceString("Ovals")); //$NON-NLS-1$
imageCb.select(0);
imageCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineCapTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineCapTab.java
index 7643a5437a..4f64d08011 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineCapTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineCapTab.java
@@ -11,10 +11,19 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates various line caps applicable to a line.
@@ -64,6 +73,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
foreground = gb;
colorButton.setImage(gb.getThumbNail());
@@ -80,6 +90,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(foreground.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineJoinTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineJoinTab.java
index 4d688617fa..e7f2aa56f3 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineJoinTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineJoinTab.java
@@ -11,10 +11,21 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates various line joins. It allows a user to choose from
@@ -73,6 +84,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("round")); //$NON-NLS-1$
joinCb.select(1);
joinCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -82,6 +94,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
shapeColor = gb;
colorButton.setImage(gb.getThumbNail());
@@ -101,6 +114,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(shapeColor.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineStyleTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineStyleTab.java
index 20f197067d..712d6b62bc 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineStyleTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/LineStyleTab.java
@@ -11,10 +11,21 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Spinner;
/**
* This tab demonstrates line styles applicable to a line. It shows the use of the
@@ -69,6 +80,7 @@ public void createControlPanel(Composite parent) {
lineWidthSpinner.setMinimum(1);
lineWidthSpinner.setMaximum(30);
lineWidthSpinner.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -77,6 +89,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
lineColor = gb;
colorButton.setImage(gb.getThumbNail());
@@ -97,6 +110,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(lineColor.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java
index 8c451651c2..980c01ffaf 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/MazeTab.java
@@ -11,11 +11,16 @@
package org.eclipse.swt.examples.graphics;
-import java.util.*;
+import java.util.ArrayList;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
/**
* This tab shows three circles, each following a different path in a maze.
@@ -131,6 +136,7 @@ public void createControlPanel(Composite parent) {
// add selection listener to reset nextNumber after
// the sequence has completed
playItem.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
if (isDone){
nextIndex = nextIndex2 = nextIndex3 = 0;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingAnimTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingAnimTab.java
index 82a54af848..9563df100d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingAnimTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingAnimTab.java
@@ -11,10 +11,19 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This is another tab that demonstrates the use of a path clipping.
@@ -69,6 +78,7 @@ public class PathClippingAnimTab extends AnimatedGraphicsTab {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
background = gb;
colorButton.setImage(gb.getThumbNail());
@@ -87,6 +97,7 @@ public class PathClippingAnimTab extends AnimatedGraphicsTab {
colorButton.setText(GraphicsExample.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(background.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java
index 666d248ab2..4c9a7f40b0 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathClippingTab.java
@@ -11,10 +11,22 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates how to apply a path clipping and the effects of
@@ -76,6 +88,7 @@ public void createControlPanel(Composite parent) {
clippingCb.add(GraphicsExample.getResourceString("Default")); //$NON-NLS-1$
clippingCb.select(0);
clippingCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -85,6 +98,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
background = gb;
colorButton.setImage(gb.getThumbNail());
@@ -104,6 +118,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(background.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathTab.java
index 0258e0eefe..cc6bc29122 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/PathTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Path;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates the use of paths. It allows the user to see the
@@ -65,6 +75,7 @@ public void createControlPanel(Composite parent) {
drawButton = new Button(comp, SWT.TOGGLE);
drawButton.setText(GraphicsExample.getResourceString("DrawPath")); //$NON-NLS-1$
drawButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -78,6 +89,7 @@ public void createControlPanel(Composite parent) {
fillButton = new Button(comp, SWT.TOGGLE);
fillButton.setText(GraphicsExample.getResourceString("FillPath")); //$NON-NLS-1$
fillButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -90,6 +102,7 @@ public void createControlPanel(Composite parent) {
closeButton = new Button(comp, SWT.TOGGLE);
closeButton.setText(GraphicsExample.getResourceString("ClosePath")); //$NON-NLS-1$
closeButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -102,6 +115,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
fillColor = gb;
colorButton.setImage(gb.getThumbNail());
@@ -117,6 +131,7 @@ public void createControlPanel(Composite parent) {
colorButton.setText(GraphicsExample.getResourceString("FillColor")); //$NON-NLS-1$
colorButton.setImage(fillColor.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java
index b6b0b7aae6..345a983614 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/RegionClippingTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates how to apply a region clipping and the effects of
@@ -77,6 +87,7 @@ public void createControlPanel(Composite parent) {
clippingCb.add(GraphicsExample.getResourceString("Inter")); //$NON-NLS-1$
clippingCb.select(0);
clippingCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -85,6 +96,7 @@ public void createControlPanel(Composite parent) {
// color menu
ColorMenu cm = new ColorMenu();
menu1 = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
colorGB1 = gb;
colorButton1.setImage(gb.getThumbNail());
@@ -92,6 +104,7 @@ public void createControlPanel(Composite parent) {
}
});
menu2 = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
colorGB2 = gb;
colorButton2.setImage(gb.getThumbNail());
@@ -113,6 +126,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color1")); //$NON-NLS-1$
colorButton1.setImage(colorGB1.getThumbNail());
colorButton1.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
@@ -132,6 +146,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color2")); //$NON-NLS-1$
colorButton2.setImage(colorGB2.getThumbNail());
colorButton2.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/SpiralTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/SpiralTab.java
index a4c3ac77d1..ce319ef667 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/SpiralTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/SpiralTab.java
@@ -11,10 +11,21 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Pattern;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Transform;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.Spinner;
/**
* This tab presents a spiral consisting of the number of petals specified.
@@ -61,6 +72,7 @@ public void createControlPanel(Composite parent) {
petalSpinner.setMinimum(3);
petalSpinner.setMaximum(20);
petalSpinner.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent (Event event) {
example.redraw();
}
@@ -73,6 +85,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setPatternItems(example.checkAdvancedGraphics());
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
foreground = gb;
colorButton.setImage(gb.getThumbNail());
@@ -89,6 +102,7 @@ public void createControlPanel(Composite parent) {
.getResourceString("Color")); //$NON-NLS-1$
colorButton.setImage(foreground.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
index 4fdd2f9fa7..b8af4caa71 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/StarPolyTab.java
@@ -10,9 +10,13 @@
*******************************************************************************/
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
public class StarPolyTab extends GraphicsTab {
int[] radial;
@@ -33,6 +37,7 @@ public void createControlPanel(Composite parent) {
fillRuleCb.add("FILL_WINDING");
fillRuleCb.select(0);
fillRuleCb.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent (Event event) {
example.redraw();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/TextAntialiasTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/TextAntialiasTab.java
index 92150be301..f0e9c0a859 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/TextAntialiasTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/graphics/TextAntialiasTab.java
@@ -11,10 +11,20 @@
package org.eclipse.swt.examples.graphics;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.graphics.Device;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
/**
* This tab demonstrates antialiasing for text. Antialiasing is used for
@@ -75,6 +85,7 @@ public void createControlPanel(Composite parent) {
aliasCombo.add("ON");
aliasCombo.select(0);
aliasCombo.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
example.redraw();
}
@@ -83,6 +94,7 @@ public void createControlPanel(Composite parent) {
ColorMenu cm = new ColorMenu();
cm.setColorItems(true);
menu = cm.createMenu(parent.getParent(), new ColorListener() {
+ @Override
public void setColor(GraphicsBackground gb) {
textColor = gb;
colorButton.setImage(gb.getThumbNail());
@@ -102,6 +114,7 @@ public void createControlPanel(Composite parent) {
colorButton.setImage(textColor.getThumbNail());
colorButton.addListener(SWT.Selection, new Listener() {
+ @Override
public void handleEvent(Event event) {
final Button button = (Button) event.widget;
final Composite parent = button.getParent();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java
index 63611549df..e879a6d5d8 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/helloworld/HelloWorld5.java
@@ -12,11 +12,18 @@ package org.eclipse.swt.examples.helloworld;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
import java.util.ResourceBundle;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Shell;
+
/*
* This example builds on HelloWorld1 and demonstrates how to draw directly
* on an SWT Control.
@@ -37,6 +44,7 @@ public Shell open (Display display) {
final Color red = new Color(display, 0xFF, 0, 0);
final Shell shell = new Shell (display);
shell.addPaintListener(new PaintListener () {
+ @Override
public void paintControl(PaintEvent event){
GC gc = event.gc;
gc.setForeground(red);
@@ -46,6 +54,7 @@ public Shell open (Display display) {
}
});
shell.addDisposeListener (new DisposeListener () {
+ @Override
public void widgetDisposed (DisposeEvent e) {
red.dispose();
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java
index a975498f78..075a1f471f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/hoverhelp/HoverHelp.java
@@ -11,15 +11,41 @@
package org.eclipse.swt.examples.hoverhelp;
-import java.io.*;
-import java.text.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
-import org.eclipse.swt.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.HelpEvent;
+import org.eclipse.swt.events.HelpListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseTrackAdapter;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Item;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
+import org.eclipse.swt.widgets.Widget;
/**
* This example demonstrates how to implement hover help feedback
* using the MouseTrackListener.
@@ -83,6 +109,7 @@ public class HoverHelp {
Shell shell = new Shell();
createPartControl(shell);
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
/* Free resources */
if (images != null) {
@@ -151,6 +178,7 @@ public class HoverHelp {
item.setData ("TIP_TEXT", getResourceString("ToolItem.tooltip",
new Object[] { item.getText(), helpKey }));
item.setData ("TIP_HELPTEXTHANDLER", new ToolTipHelpTextHandler() {
+ @Override
public String getHelpText(Widget widget) {
Item item = (Item) widget;
return getResourceString("ToolItem.help", new Object[] { item.getText() });
@@ -171,6 +199,7 @@ public class HoverHelp {
item.setData ("TIP_TEXT", getResourceString("TableItem.tooltip",
new Object[] { item.getText(), helpKey }));
item.setData ("TIP_HELPTEXTHANDLER", new ToolTipHelpTextHandler() {
+ @Override
public String getHelpText(Widget widget) {
Item item = (Item) widget;
return getResourceString("TableItem.help", new Object[] { item.getText() });
@@ -189,6 +218,7 @@ public class HoverHelp {
item.setData ("TIP_TEXT", getResourceString("TreeItem.tooltip",
new Object[] { item.getText(), helpKey}));
item.setData ("TIP_HELPTEXTHANDLER", new ToolTipHelpTextHandler() {
+ @Override
public String getHelpText(Widget widget) {
Item item = (Item) widget;
return getResourceString("TreeItem.help", new Object[] { item.getText() });
@@ -312,6 +342,7 @@ public class HoverHelp {
* Trap F1 Help to pop up a custom help box
*/
control.addHelpListener(new HelpListener () {
+ @Override
public void helpRequested(HelpEvent event) {
if (tipWidget == null) return;
ToolTipHelpTextHandler handler = (ToolTipHelpTextHandler)
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
index 91c739ceab..a630c715e6 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/imageanalyzer/ImageAnalyzer.java
@@ -11,18 +11,67 @@
package org.eclipse.swt.examples.imageanalyzer;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.printing.*;
-import org.eclipse.swt.custom.*;
-
-import java.util.*;
-import java.net.*;
-import java.io.*;
+import java.io.InputStream;
+import java.net.URL;
import java.text.MessageFormat;
+import java.util.ResourceBundle;
+import java.util.Vector;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTError;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.KeyAdapter;
+import org.eclipse.swt.events.KeyEvent;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Cursor;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.ImageLoader;
+import org.eclipse.swt.graphics.ImageLoaderEvent;
+import org.eclipse.swt.graphics.ImageLoaderListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.layout.RowLayout;
+import org.eclipse.swt.printing.PrintDialog;
+import org.eclipse.swt.printing.Printer;
+import org.eclipse.swt.printing.PrinterData;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Dialog;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Sash;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
public class ImageAnalyzer {
static ResourceBundle bundle = ResourceBundle.getBundle("examples_images");
@@ -188,6 +237,7 @@ public class ImageAnalyzer {
}
});
shell.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
// Clean up.
if (image != null)
@@ -218,6 +268,7 @@ public class ImageAnalyzer {
// Create a GC for drawing, and hook the listener to dispose it.
imageCanvasGC = new GC(imageCanvas);
imageCanvas.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
imageCanvasGC.dispose();
}
@@ -481,6 +532,7 @@ public class ImageAnalyzer {
gridData.grabExcessVerticalSpace = true;
imageCanvas.setLayoutData(gridData);
imageCanvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent event) {
if (image == null) {
Rectangle bounds = imageCanvas.getBounds();
@@ -491,6 +543,7 @@ public class ImageAnalyzer {
}
});
imageCanvas.addMouseMoveListener(new MouseMoveListener() {
+ @Override
public void mouseMove(MouseEvent event) {
if (image != null) {
showColorAt(event.x, event.y);
@@ -597,6 +650,7 @@ public class ImageAnalyzer {
gridData.heightHint = 16 * 11; // show at least 16 colors
paletteCanvas.setLayoutData(gridData);
paletteCanvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent event) {
if (image != null)
paintPalette(event);
@@ -961,6 +1015,7 @@ public class ImageAnalyzer {
if (incremental) {
// Prepare to handle incremental events.
loader.addImageLoaderListener(new ImageLoaderListener() {
+ @Override
public void imageDataLoaded(ImageLoaderEvent event) {
incrementalDataLoaded(event);
}
@@ -1022,6 +1077,7 @@ public class ImageAnalyzer {
if (incremental) {
// Prepare to handle incremental events.
loader.addImageLoaderListener(new ImageLoaderListener() {
+ @Override
public void imageDataLoaded(ImageLoaderEvent event) {
incrementalDataLoaded(event);
}
@@ -1577,6 +1633,7 @@ public class ImageAnalyzer {
animateLoop();
} catch (final SWTException e) {
display.syncExec(new Runnable() {
+ @Override
public void run() {
showErrorDialog(createMsg(bundle.getString("Creating_image"),
new Integer(imageDataIndex+1)),
@@ -1607,6 +1664,7 @@ public class ImageAnalyzer {
try {
// Use syncExec to get the background color of the imageCanvas.
display.syncExec(new Runnable() {
+ @Override
public void run() {
canvasBackground = imageCanvas.getBackground();
}
@@ -1709,6 +1767,7 @@ public class ImageAnalyzer {
*/
void preAnimation() {
display.syncExec(new Runnable() {
+ @Override
public void run() {
// Change the label of the Animate button to 'Stop'.
animateButton.setText(bundle.getString("Stop"));
@@ -1738,6 +1797,7 @@ public class ImageAnalyzer {
*/
void postAnimation() {
display.syncExec(new Runnable() {
+ @Override
public void run() {
// Enable anything we disabled before the animation.
previousButton.setEnabled(true);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
index a186742a89..a3c640789c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaLineStyler.java
@@ -11,13 +11,19 @@
package org.eclipse.swt.examples.javaviewer;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.Hashtable;
+import java.util.Vector;
-import java.util.*;
-import java.io.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.LineStyleEvent;
+import org.eclipse.swt.custom.LineStyleListener;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
class JavaLineStyler implements LineStyleListener {
JavaScanner scanner = new JavaScanner();
@@ -92,6 +98,7 @@ void disposeColors() {
* LineStyleEvent.styles Enumeration of StyleRanges, need to be in order. (output)
* LineStyleEvent.background line background color (output)
*/
+@Override
public void lineGetStyle(LineStyleEvent event) {
Vector<StyleRange> styles = new Vector<StyleRange>();
int token;
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java
index e7b1b01cf9..07296a23f9 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/javaviewer/JavaViewer.java
@@ -11,15 +11,31 @@
package org.eclipse.swt.examples.javaviewer;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import java.util.*;
-import java.io.*;
-import java.text.*;
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStreamReader;
+import java.io.Reader;
+import java.text.MessageFormat;
+import java.util.ResourceBundle;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.ShellAdapter;
+import org.eclipse.swt.events.ShellEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
/**
*/
@@ -171,6 +187,7 @@ void open(String name) {
// Guard against superfluous mouse move events -- defer action until later
Display display = text.getDisplay();
display.asyncExec(new Runnable() {
+ @Override
public void run() {
text.setText(textString);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java
index eff2adb835..9182960282 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/GridLayoutTab.java
@@ -11,12 +11,24 @@
package org.eclipse.swt.examples.layoutexample;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
class GridLayoutTab extends Tab {
/* Controls for setting layout parameters */
@@ -64,6 +76,7 @@ class GridLayoutTab extends Tab {
void createChildWidgets () {
/* Create the TraverseListener */
final TraverseListener traverseListener = new TraverseListener () {
+ @Override
public void keyTraversed (TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_RETURN || e.detail == SWT.TRAVERSE_TAB_NEXT)
resetEditors ();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java
index 52cc0aa74d..9678e61b3b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/layoutexample/Tab.java
@@ -13,12 +13,49 @@ package org.eclipse.swt.examples.layoutexample;
import java.util.Vector;
-import org.eclipse.swt.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.custom.CCombo;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.custom.TableEditor;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.SelectionListener;
+import org.eclipse.swt.events.TraverseEvent;
+import org.eclipse.swt.events.TraverseListener;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Link;
+import org.eclipse.swt.widgets.List;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.ProgressBar;
+import org.eclipse.swt.widgets.Scale;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Slider;
+import org.eclipse.swt.widgets.TabFolder;
+import org.eclipse.swt.widgets.Table;
+import org.eclipse.swt.widgets.TableColumn;
+import org.eclipse.swt.widgets.TableItem;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+import org.eclipse.swt.widgets.TreeItem;
/**
* <code>Tab</code> is the abstract superclass of every page
@@ -72,6 +109,7 @@ abstract class Tab {
};
TraverseListener traverseListener = new TraverseListener () {
+ @Override
public void keyTraversed (TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_RETURN) {
e.doit = false;
@@ -301,7 +339,8 @@ abstract class Tab {
/* Add listener */
combo.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
+ @Override
+ public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_TAB_NEXT || e.detail == SWT.TRAVERSE_RETURN) {
comboReset = true;
resetEditors ();
@@ -431,7 +470,8 @@ abstract class Tab {
textEditor.setEditor (text, newItem, column);
text.addTraverseListener(new TraverseListener() {
- public void keyTraversed(TraverseEvent e) {
+ @Override
+ public void keyTraversed(TraverseEvent e) {
if (e.detail == SWT.TRAVERSE_TAB_NEXT) {
resetEditors (true);
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java
index ad46cd4669..17db632898 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/AirbrushTool.java
@@ -12,7 +12,8 @@ package org.eclipse.swt.examples.paint;
import java.util.Random;
-import org.eclipse.swt.graphics.*;
+
+import org.eclipse.swt.graphics.Point;
/**
* An airbrush tool.
@@ -41,6 +42,7 @@ public class AirbrushTool extends ContinuousPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
// compute things we need to know for drawing
settings = toolSettings;
@@ -55,6 +57,7 @@ public class AirbrushTool extends ContinuousPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Airbrush.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
index fc2fdf44f4..2f3cd66b5c 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/BasicPaintSession.java
@@ -31,6 +31,7 @@ public abstract class BasicPaintSession implements PaintSession {
*
* @return the associated PaintSurface
*/
+ @Override
public PaintSurface getPaintSurface() {
return paintSurface;
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
index b415351a0a..ba303f83ac 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/ContinuousPaintSession.java
@@ -11,9 +11,9 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.widgets.Display;
/**
* The superclass for paint tools that draw continuously along the path
@@ -64,6 +64,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
/**
* Activates the tool.
*/
+ @Override
public void beginSession() {
getPaintSurface().
setStatusMessage(PaintExample.getResourceString("session.ContinuousPaint.message"));
@@ -73,6 +74,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
/**
* Deactivates the tool.
*/
+ @Override
public void endSession() {
abortRetrigger();
}
@@ -80,6 +82,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
/**
* Aborts the current operation.
*/
+ @Override
public void resetSession() {
abortRetrigger();
}
@@ -89,6 +92,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public final void mouseDown(MouseEvent event) {
if (event.button != 1) return;
if (dragInProgress) return; // spurious event
@@ -105,6 +109,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public final void mouseDoubleClick(MouseEvent event) {
}
@@ -113,6 +118,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public final void mouseUp(MouseEvent event) {
if (event.button != 1) return;
if (! dragInProgress) return; // spurious event
@@ -126,6 +132,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public final void mouseMove(MouseEvent event) {
final PaintSurface ps = getPaintSurface();
ps.setStatusCoord(ps.getCurrentPosition());
@@ -208,6 +215,7 @@ public abstract class ContinuousPaintSession extends BasicPaintSession {
*/
Display display = getPaintSurface().getDisplay();
retriggerHandler = new Runnable() {
+ @Override
public void run() {
if (retriggerHandler == this) {
render(points[0]);
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
index 0401ca2bbb..6dc49bd4b4 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/DragPaintSession.java
@@ -12,7 +12,7 @@ package org.eclipse.swt.examples.paint;
import org.eclipse.swt.events.MouseEvent;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* The superclass for paint tools that use click-drag-release motions to
@@ -46,6 +46,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
/**
* Activates the tool.
*/
+ @Override
public void beginSession() {
getPaintSurface().
setStatusMessage(PaintExample.getResourceString("session.DragInteractivePaint.message"));
@@ -56,6 +57,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
/**
* Deactivates the tool.
*/
+ @Override
public void endSession() {
}
@@ -63,6 +65,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
* Resets the tool.
* Aborts any operation in progress.
*/
+ @Override
public void resetSession() {
getPaintSurface().clearRubberbandSelection();
anchorPosition.x = -1;
@@ -74,6 +77,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseDown(MouseEvent event) {
if (event.button != 1) return;
if (dragInProgress) return; // spurious event
@@ -88,6 +92,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseDoubleClick(MouseEvent event) {
}
@@ -96,6 +101,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseUp(MouseEvent event) {
if (event.button != 1) {
resetSession(); // abort if right or middle mouse button pressed
@@ -113,6 +119,7 @@ public abstract class DragPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseMove(MouseEvent event) {
final PaintSurface ps = getPaintSurface();
if (! dragInProgress) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java
index 2eefaefd16..ab0157f5a7 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/EllipseTool.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* A drawing tool.
@@ -35,6 +35,7 @@ public class EllipseTool extends DragPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -44,6 +45,7 @@ public class EllipseTool extends DragPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Ellipse.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java
index 3fbfe65e2f..c08ffc2b2b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/LineTool.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* A line drawing tool
@@ -35,6 +35,7 @@ public class LineTool extends DragPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -44,6 +45,7 @@ public class LineTool extends DragPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Line.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
index 748bb4f6fd..d038417814 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintExample.java
@@ -11,16 +11,39 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.accessibility.*;
-
-import java.io.*;
-import java.text.*;
-import java.util.*;
+import java.io.IOException;
+import java.io.InputStream;
+import java.text.MessageFormat;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.SWTException;
+import org.eclipse.swt.accessibility.AccessibleAdapter;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FontDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Scale;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
public class PaintExample {
private static ResourceBundle resourceBundle =
@@ -251,6 +274,7 @@ public class PaintExample {
gridData.heightHint = 24;
paletteCanvas.setLayoutData(gridData);
paletteCanvas.addListener(SWT.MouseDown, new Listener() {
+ @Override
public void handleEvent(Event e) {
Rectangle bounds = paletteCanvas.getClientArea();
Color color = getColorAt(bounds, e.x, e.y);
@@ -266,6 +290,7 @@ public class PaintExample {
}
});
Listener refreshListener = new Listener() {
+ @Override
public void handleEvent(Event e) {
if (e.gc == null) return;
Rectangle bounds = paletteCanvas.getClientArea();
@@ -428,24 +453,28 @@ public class PaintExample {
String group = tool.group;
if (group.equals("tool")) {
tool.action = new Runnable() {
+ @Override
public void run() {
setPaintTool(tool.id);
}
};
} else if (group.equals("fill")) {
tool.action = new Runnable() {
+ @Override
public void run() {
setFillType(tool.id);
}
};
} else if (group.equals("linestyle")) {
tool.action = new Runnable() {
+ @Override
public void run() {
setLineStyle(tool.id);
}
};
} else if (group.equals("options")) {
tool.action = new Runnable() {
+ @Override
public void run() {
FontDialog fontDialog = new FontDialog(paintSurface.getShell(), SWT.PRIMARY_MODAL);
FontData[] fontDatum = toolSettings.commonFont.getFontData();
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java
index 374c7dbd0f..e67556e401 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PaintSurface.java
@@ -10,9 +10,28 @@
*******************************************************************************/
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.widgets.*;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.DisposeEvent;
+import org.eclipse.swt.events.DisposeListener;
+import org.eclipse.swt.events.MouseAdapter;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.MouseMoveListener;
+import org.eclipse.swt.events.PaintEvent;
+import org.eclipse.swt.events.PaintListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Region;
+import org.eclipse.swt.widgets.Canvas;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.ScrollBar;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
/**
* Manages a simple drawing surface.
@@ -72,6 +91,7 @@ public class PaintSurface {
/* Add our listeners */
paintCanvas.addDisposeListener(new DisposeListener() {
+ @Override
public void widgetDisposed(DisposeEvent e) {
displayFDC.gc.dispose();
}
@@ -94,12 +114,14 @@ public class PaintSurface {
}
});
paintCanvas.addMouseMoveListener(new MouseMoveListener() {
+ @Override
public void mouseMove(MouseEvent event) {
processMouseEventCoordinates(event);
if (paintSession != null) paintSession.mouseMove(event);
}
});
paintCanvas.addPaintListener(new PaintListener() {
+ @Override
public void paintControl(PaintEvent event) {
if (rubberband.isEmpty()) {
// Nothing to merge, so we just refresh
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java
index 305ac9b4e3..bcb63daf26 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PencilTool.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* A pencil tool.
@@ -35,6 +35,7 @@ public class PencilTool extends ContinuousPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -44,6 +45,7 @@ public class PencilTool extends ContinuousPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Pencil.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java
index be7679bc26..836fe7276b 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/PolyLineTool.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* A polyline drawing tool.
@@ -35,6 +35,7 @@ public class PolyLineTool extends SegmentedPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -44,6 +45,7 @@ public class PolyLineTool extends SegmentedPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.PolyLine.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java
index 15d01e8c8c..20b30e3aec 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RectangleTool.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* A drawing tool.
@@ -35,6 +35,7 @@ public class RectangleTool extends DragPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -44,6 +45,7 @@ public class RectangleTool extends DragPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Rectangle.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
index f9d520ac15..e9fb6f7b6d 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/RoundedRectangleTool.java
@@ -11,7 +11,7 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.graphics.*;
+import org.eclipse.swt.graphics.Point;
/**
* A drawing tool.
@@ -35,6 +35,7 @@ public class RoundedRectangleTool extends DragPaintSession implements PaintTool
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -44,6 +45,7 @@ public class RoundedRectangleTool extends DragPaintSession implements PaintTool
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.RoundedRectangle.label");
}
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
index 4d9d8d424b..90811d1b57 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/SegmentedPaintSession.java
@@ -11,10 +11,10 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
+import java.util.Vector;
-import java.util.*;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.graphics.Point;
/**
* The superclass for paint tools that contruct objects from individually
@@ -48,6 +48,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
/**
* Activates the tool.
*/
+ @Override
public void beginSession() {
getPaintSurface().setStatusMessage(PaintExample.getResourceString(
"session.SegmentedInteractivePaint.message.anchorMode"));
@@ -59,6 +60,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
/**
* Deactivates the tool.
*/
+ @Override
public void endSession() {
getPaintSurface().clearRubberbandSelection();
if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
@@ -68,6 +70,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
* Resets the tool.
* Aborts any operation in progress.
*/
+ @Override
public void resetSession() {
getPaintSurface().clearRubberbandSelection();
if (previousFigure != null) getPaintSurface().drawFigure(previousFigure);
@@ -84,6 +87,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseDown(MouseEvent event) {
if (event.button != 1) return;
@@ -103,6 +107,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseDoubleClick(MouseEvent event) {
if (event.button != 1) return;
if (controlPoints.size() >= 2) {
@@ -119,6 +124,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseUp(MouseEvent event) {
if (event.button != 1) {
resetSession(); // abort if right or middle mouse button pressed
@@ -131,6 +137,7 @@ public abstract class SegmentedPaintSession extends BasicPaintSession {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseMove(MouseEvent event) {
final PaintSurface ps = getPaintSurface();
if (controlPoints.size() == 0) {
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
index e9f64253cc..2271fb0f1f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/paint/TextTool.java
@@ -11,10 +11,18 @@
package org.eclipse.swt.examples.paint;
-import org.eclipse.swt.*;
-import org.eclipse.swt.widgets.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.layout.*;
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.MouseEvent;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Text;
/**
* A text drawing tool.
@@ -39,6 +47,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
*
* @param toolSettings the new tool settings
*/
+ @Override
public void set(ToolSettings toolSettings) {
settings = toolSettings;
}
@@ -48,6 +57,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
*
* @return the localized name of this tool
*/
+ @Override
public String getDisplayName() {
return PaintExample.getResourceString("tool.Text.label");
}
@@ -55,6 +65,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
/**
* Activates the tool.
*/
+ @Override
public void beginSession() {
getPaintSurface().setStatusMessage(PaintExample.getResourceString(
"session.Text.message"));
@@ -63,6 +74,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
/**
* Deactivates the tool.
*/
+ @Override
public void endSession() {
getPaintSurface().clearRubberbandSelection();
}
@@ -70,6 +82,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
/**
* Aborts the current operation.
*/
+ @Override
public void resetSession() {
getPaintSurface().clearRubberbandSelection();
}
@@ -79,6 +92,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseDown(MouseEvent event) {
if (event.button == 1) {
// draw with left mouse button
@@ -135,6 +149,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseDoubleClick(MouseEvent event) {
}
@@ -143,6 +158,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseUp(MouseEvent event) {
}
@@ -151,6 +167,7 @@ public class TextTool extends BasicPaintSession implements PaintTool {
*
* @param event the mouse event detail information
*/
+ @Override
public void mouseMove(MouseEvent event) {
final PaintSurface ps = getPaintSurface();
ps.setStatusCoord(ps.getCurrentPosition());
diff --git a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
index 2341a2cf1b..c23a89f64f 100644
--- a/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
+++ b/examples/org.eclipse.swt.examples/src/org/eclipse/swt/examples/texteditor/TextEditor.java
@@ -10,15 +10,71 @@
*******************************************************************************/
package org.eclipse.swt.examples.texteditor;
-import java.io.*;
-import java.util.*;
-import org.eclipse.swt.*;
-import org.eclipse.swt.browser.*;
-import org.eclipse.swt.custom.*;
-import org.eclipse.swt.events.*;
-import org.eclipse.swt.graphics.*;
-import org.eclipse.swt.layout.*;
-import org.eclipse.swt.widgets.*;
+import java.io.BufferedReader;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.util.MissingResourceException;
+import java.util.ResourceBundle;
+import java.util.StringTokenizer;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.browser.Browser;
+import org.eclipse.swt.custom.Bullet;
+import org.eclipse.swt.custom.CaretEvent;
+import org.eclipse.swt.custom.CaretListener;
+import org.eclipse.swt.custom.PaintObjectEvent;
+import org.eclipse.swt.custom.PaintObjectListener;
+import org.eclipse.swt.custom.ST;
+import org.eclipse.swt.custom.StyleRange;
+import org.eclipse.swt.custom.StyledText;
+import org.eclipse.swt.events.ControlAdapter;
+import org.eclipse.swt.events.ControlEvent;
+import org.eclipse.swt.events.MenuAdapter;
+import org.eclipse.swt.events.MenuEvent;
+import org.eclipse.swt.events.ModifyEvent;
+import org.eclipse.swt.events.ModifyListener;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.events.VerifyEvent;
+import org.eclipse.swt.events.VerifyListener;
+import org.eclipse.swt.graphics.Color;
+import org.eclipse.swt.graphics.Font;
+import org.eclipse.swt.graphics.FontData;
+import org.eclipse.swt.graphics.GC;
+import org.eclipse.swt.graphics.GlyphMetrics;
+import org.eclipse.swt.graphics.Image;
+import org.eclipse.swt.graphics.ImageData;
+import org.eclipse.swt.graphics.Point;
+import org.eclipse.swt.graphics.RGB;
+import org.eclipse.swt.graphics.Rectangle;
+import org.eclipse.swt.graphics.Resource;
+import org.eclipse.swt.layout.FillLayout;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.ColorDialog;
+import org.eclipse.swt.widgets.Combo;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.CoolBar;
+import org.eclipse.swt.widgets.CoolItem;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.swt.widgets.Event;
+import org.eclipse.swt.widgets.FileDialog;
+import org.eclipse.swt.widgets.FontDialog;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Listener;
+import org.eclipse.swt.widgets.Menu;
+import org.eclipse.swt.widgets.MenuItem;
+import org.eclipse.swt.widgets.MessageBox;
+import org.eclipse.swt.widgets.Shell;
+import org.eclipse.swt.widgets.Spinner;
+import org.eclipse.swt.widgets.Text;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
public class TextEditor {
Display display;
@@ -511,6 +567,7 @@ public class TextEditor {
cutItem.setText (getResourceString("Cut_menuitem")); //$NON-NLS-1$
cutItem.setImage(iCut);
cutItem.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
styledText.cut();
}
@@ -519,6 +576,7 @@ public class TextEditor {
copyItem.setText (getResourceString("Copy_menuitem")); //$NON-NLS-1$
copyItem.setImage(iCopy);
copyItem.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
styledText.copy();
}
@@ -527,6 +585,7 @@ public class TextEditor {
pasteItem.setText (getResourceString("Paste_menuitem")); //$NON-NLS-1$
pasteItem.setImage(iPaste);
pasteItem.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
styledText.paste();
}
@@ -535,6 +594,7 @@ public class TextEditor {
final MenuItem selectAllItem = new MenuItem (menu, SWT.PUSH);
selectAllItem.setText (getResourceString("SelectAll_menuitem")); //$NON-NLS-1$
selectAllItem.addListener (SWT.Selection, new Listener () {
+ @Override
public void handleEvent (Event event) {
styledText.selectAll();
}
@@ -1259,37 +1319,44 @@ public class TextEditor {
void installListeners() {
styledText.addCaretListener(new CaretListener() {
+ @Override
public void caretMoved(CaretEvent event) {
updateStatusBar();
updateToolBar();
}
});
styledText.addListener(SWT.MouseUp, new Listener() {
+ @Override
public void handleEvent(Event event) {
handleMouseUp(event);
}
});
styledText.addListener(SWT.KeyDown, new Listener() {
+ @Override
public void handleEvent(Event event) {
handleKeyDown(event);
}
});
styledText.addVerifyListener(new VerifyListener() {
+ @Override
public void verifyText(VerifyEvent event) {
handleVerifyText(event);
}
});
styledText.addModifyListener(new ModifyListener(){
+ @Override
public void modifyText(ModifyEvent event) {
handleModify(event);
}
});
styledText.addPaintObjectListener(new PaintObjectListener() {
+ @Override
public void paintObject(PaintObjectEvent event) {
handlePaintObject(event);
}
});
styledText.addListener(SWT.Dispose, new Listener() {
+ @Override
public void handleEvent(Event event) {
StyleRange[] styles = styledText.getStyleRanges(0, styledText.getCharCount(), false);
for (int i = 0; i < styles.length; i++) {
@@ -1474,6 +1541,7 @@ public class TextEditor {
final Button cancelButton = new Button(dialog, SWT.PUSH);
cancelButton.setText(getResourceString("Cancel")); //$NON-NLS-1$
Listener listener = new Listener() {
+ @Override
public void handleEvent(Event event) {
if (event.widget == okButton) {
link = text.getText();

Back to the top