diff options
author | Waqas Ilyas | 2015-03-11 04:39:08 +0000 |
---|---|---|
committer | Lars Vogel | 2015-03-11 12:35:55 +0000 |
commit | afb7c27cee118677bdcdad5207e866b9196333ae (patch) | |
tree | b72c707f284a1bb881fbd6ff2ae5e94c98dd84e1 | |
parent | f196f682f07ac740363ecb3b57396ba1c9bf391b (diff) | |
download | eclipse.platform.ui-afb7c27cee118677bdcdad5207e866b9196333ae.tar.gz eclipse.platform.ui-afb7c27cee118677bdcdad5207e866b9196333ae.tar.xz eclipse.platform.ui-afb7c27cee118677bdcdad5207e866b9196333ae.zip |
Bug 461794 - Solve whitespace issues in eclipse.ui plug-ins
Change-Id: Iaa569fa40514628108da074287a6012f715d9588
Signed-off-by: Waqas Ilyas <waqas.ilyas@gmail.com>
4 files changed, 53 insertions, 52 deletions
diff --git a/examples/org.eclipse.jface.snippets/.settings/org.eclipse.jdt.core.prefs b/examples/org.eclipse.jface.snippets/.settings/org.eclipse.jdt.core.prefs index c7112e9844b..0bb2bd91a9a 100644 --- a/examples/org.eclipse.jface.snippets/.settings/org.eclipse.jdt.core.prefs +++ b/examples/org.eclipse.jface.snippets/.settings/org.eclipse.jdt.core.prefs @@ -399,3 +399,4 @@ org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true +org.eclipse.jdt.core.javaFormatter=org.eclipse.jdt.core.defaultJavaFormatter diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java index 683030351ba..578ec8f61bd 100644 --- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java +++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/dialogs/Snippet012DialogWithImageButtons.java @@ -26,24 +26,24 @@ import org.eclipse.swt.widgets.Shell; */ public class Snippet012DialogWithImageButtons { private ImageRegistry registry; - + public Snippet012DialogWithImageButtons(final Shell shell) { - + Dialog dia = new Dialog(shell) { private ImageDescriptor getImageDescriptor(String path) { if( registry == null ) { registry = new ImageRegistry(shell.getDisplay()); } - + ImageDescriptor desc = registry.getDescriptor(path); if( desc == null ) { desc = ImageDescriptor.createFromFile(Snippet012DialogWithImageButtons.class, path); registry.put(path, desc); } - + return desc; } - + protected Button createButton(Composite parent, int id, String label, boolean defaultButton) { Button b = super.createButton(parent, id, label, defaultButton); if( id == IDialogConstants.OK_ID ) { @@ -56,27 +56,27 @@ public class Snippet012DialogWithImageButtons { setButtonLayoutData(b); return b; } - + return b; } }; dia.open(); } - + public static void main(String[] args) { - + Display display = new Display (); Shell shell = new Shell(display); shell.setLayout(new FillLayout()); - + shell.open (); - + new Snippet012DialogWithImageButtons(shell); - + while (!shell.isDisposed ()) { if (!display.readAndDispatch ()) display.sleep (); } - + display.dispose (); } } diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java index c5df695148b..5d91d3bffac 100644 --- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java +++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/viewers/Snippet047VirtualLazyTreeViewer.java @@ -22,7 +22,7 @@ import org.eclipse.swt.widgets.Shell; /** * A simple TreeViewer to demonstrate usage of an ILazyContentProvider. - * + * */ public class Snippet047VirtualLazyTreeViewer { private class MyContentProvider implements ILazyTreeContentProvider { @@ -52,31 +52,31 @@ public class Snippet047VirtualLazyTreeViewer { @Override public void updateChildCount(Object element, int currentChildCount) { - + int length = 0; if (element instanceof IntermediateNode) { IntermediateNode node = (IntermediateNode) element; length = node.children.length; - } + } if(element == elements) length = elements.length; viewer.setChildCount(element, length); - + } @Override public void updateElement(Object parent, int index) { - + Object element; - if (parent instanceof IntermediateNode) + if (parent instanceof IntermediateNode) element = ((IntermediateNode) parent).children[index]; - + else element = elements[index]; viewer.replace(parent, index, element); updateChildCount(element, -1); - + } } diff --git a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java index 704321b0ae8..c5505a27bad 100644 --- a/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java +++ b/examples/org.eclipse.jface.snippets/Eclipse JFace Snippets/org/eclipse/jface/snippets/window/Snippet020CustomizedControlTooltips.java @@ -41,26 +41,26 @@ import org.eclipse.swt.widgets.Text; /** * Demonstrate usage of custom toolstips for controls - * + * * @author Tom Schindl - * + * */ public class Snippet020CustomizedControlTooltips { protected class MyToolTip extends ToolTip { - + private Shell parentShell; - + private String headerText = "ToolTip-Header"; - + public static final String HEADER_BG_COLOR = Policy.JFACE + ".TOOLTIP_HEAD_BG_COLOR"; - + public static final String HEADER_FG_COLOR = Policy.JFACE + ".TOOLTIP_HEAD_FG_COLOR"; - + public static final String HEADER_FONT = Policy.JFACE + ".TOOLTIP_HEAD_FONT"; - + public static final String HEADER_CLOSE_ICON = Policy.JFACE + ".TOOLTIP_CLOSE_ICON"; public static final String HEADER_HELP_ICON = Policy.JFACE + ".TOOLTIP_HELP_ICON"; - + public MyToolTip(Control control) { super(control); this.parentShell = control.getShell(); @@ -69,7 +69,7 @@ public class Snippet020CustomizedControlTooltips { protected Composite createToolTipContentArea(Event event, Composite parent) { Composite comp = new Composite(parent,SWT.NONE); - + GridLayout gl = new GridLayout(1,false); gl.marginBottom=0; gl.marginTop=0; @@ -79,13 +79,13 @@ public class Snippet020CustomizedControlTooltips { gl.marginRight=0; gl.verticalSpacing=1; comp.setLayout(gl); - + Composite topArea = new Composite(comp,SWT.NONE); GridData data = new GridData(SWT.FILL,SWT.FILL,true,false); data.widthHint=200; topArea.setLayoutData(data); topArea.setBackground(JFaceResources.getColorRegistry().get(HEADER_BG_COLOR)); - + gl = new GridLayout(2,false); gl.marginBottom=2; gl.marginTop=2; @@ -93,21 +93,21 @@ public class Snippet020CustomizedControlTooltips { gl.marginWidth=0; gl.marginLeft=5; gl.marginRight=2; - + topArea.setLayout(gl); - + Label l = new Label(topArea,SWT.NONE); l.setText(headerText); l.setBackground(JFaceResources.getColorRegistry().get(HEADER_BG_COLOR)); l.setFont(JFaceResources.getFontRegistry().get(HEADER_FONT)); l.setForeground(JFaceResources.getColorRegistry().get(HEADER_FG_COLOR)); l.setLayoutData(new GridData(GridData.FILL_BOTH)); - + Composite iconComp = new Composite(topArea,SWT.NONE); iconComp.setLayoutData(new GridData()); iconComp.setLayout(new GridLayout(2,false)); iconComp.setBackground(JFaceResources.getColorRegistry().get(HEADER_BG_COLOR)); - + gl = new GridLayout(2,false); gl.marginBottom=0; gl.marginTop=0; @@ -116,7 +116,7 @@ public class Snippet020CustomizedControlTooltips { gl.marginLeft=0; gl.marginRight=0; iconComp.setLayout(gl); - + Label helpIcon = new Label(iconComp,SWT.NONE); helpIcon.setBackground(JFaceResources.getColorRegistry().get(HEADER_BG_COLOR)); helpIcon.setImage(JFaceResources.getImage(HEADER_HELP_ICON)); @@ -127,8 +127,8 @@ public class Snippet020CustomizedControlTooltips { openHelp(); } }); - - + + Label closeIcon = new Label(iconComp,SWT.NONE); closeIcon.setBackground(JFaceResources.getColorRegistry().get(HEADER_BG_COLOR)); closeIcon.setImage(JFaceResources.getImage(HEADER_CLOSE_ICON)); @@ -139,16 +139,16 @@ public class Snippet020CustomizedControlTooltips { hide(); } }); - + createContentArea(comp).setLayoutData(new GridData(GridData.FILL_BOTH)); - + return comp; } - + protected Composite createContentArea(Composite parent) { return new Composite(parent,SWT.NONE); } - + protected void openHelp() { parentShell.setFocus(); } @@ -158,10 +158,10 @@ public class Snippet020CustomizedControlTooltips { JFaceResources.getColorRegistry().put(MyToolTip.HEADER_BG_COLOR, new RGB(255,255,255)); JFaceResources.getFontRegistry().put(MyToolTip.HEADER_FONT, JFaceResources.getFontRegistry().getBold(JFaceResources.getDefaultFont().getFontData()[0].getName()).getFontData()); - + JFaceResources.getImageRegistry().put(MyToolTip.HEADER_CLOSE_ICON,ImageDescriptor.createFromFile(Snippet020CustomizedControlTooltips.class, "showerr_tsk.gif")); JFaceResources.getImageRegistry().put(MyToolTip.HEADER_HELP_ICON,ImageDescriptor.createFromFile(Snippet020CustomizedControlTooltips.class, "linkto_help.gif")); - + Text text = new Text(parent,SWT.BORDER); text.setText("Hello World"); @@ -183,7 +183,7 @@ public class Snippet020CustomizedControlTooltips { }); return comp; } - + protected void openURL() { MessageBox box = new MessageBox(parent,SWT.ICON_INFORMATION); box.setText("Eclipse.org"); @@ -197,7 +197,7 @@ public class Snippet020CustomizedControlTooltips { box.setMessage("Here is where we'd show some information."); box.open(); } - + }; myTooltipLabel.setShift(new Point(-5, -5)); myTooltipLabel.setHideOnMouseDown(false); @@ -208,22 +208,22 @@ public class Snippet020CustomizedControlTooltips { DefaultToolTip toolTip = new DefaultToolTip(text); toolTip.setText("Hello World\nHello World"); toolTip.setBackgroundColor(parent.getDisplay().getSystemColor(SWT.COLOR_RED)); - + Button b = new Button(parent,SWT.PUSH); b.setText("Popup on press"); - + final DefaultToolTip toolTipDelayed = new DefaultToolTip(b,ToolTip.RECREATE,true); toolTipDelayed.setText("Hello World\nHello World"); toolTipDelayed.setBackgroundColor(parent.getDisplay().getSystemColor(SWT.COLOR_RED)); toolTipDelayed.setHideDelay(2000); - + b.addSelectionListener(new SelectionAdapter() { public void widgetSelected(SelectionEvent e) { toolTipDelayed.show(new Point(0,0)); } }); - - + + } public static void main(String[] args) { |