diff options
author | Felipe Heidrich <fheidric> | 2009-02-17 22:40:53 +0000 |
---|---|---|
committer | Felipe Heidrich <fheidric> | 2009-02-17 22:40:53 +0000 |
commit | ed4af8558935206a6140493672a9acfb3db2cef3 (patch) | |
tree | 1f036d6638781bfcd063eb95b4df454285e9d7c3 /bundles/org.eclipse.swt | |
parent | e4de5e48d2fd11782d0a2d1c87edee6f302ca529 (diff) | |
download | eclipse.platform.swt-ed4af8558935206a6140493672a9acfb3db2cef3.tar.gz eclipse.platform.swt-ed4af8558935206a6140493672a9acfb3db2cef3.tar.xz eclipse.platform.swt-ed4af8558935206a6140493672a9acfb3db2cef3.zip |
refactoring
Diffstat (limited to 'bundles/org.eclipse.swt')
2 files changed, 9 insertions, 8 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java index 7393bfaf75..371e5b6ac5 100755 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashForm.java @@ -95,6 +95,13 @@ static int checkStyle (int style) { int mask = SWT.BORDER | SWT.LEFT_TO_RIGHT | SWT.RIGHT_TO_LEFT; return style & mask; } +Sash createSash() { + Sash sash = new Sash(this, sashStyle); + sash.setBackground(background); + sash.setForeground(foreground); + sash.addListener(SWT.Selection, sashListener); + return sash; +} /** * Returns SWT.HORIZONTAL if the controls in the SashForm are laid out side by side * or SWT.VERTICAL if the controls in the SashForm are laid out top to bottom. @@ -296,10 +303,7 @@ public void setOrientation(int orientation) { sashStyle |= orientation == SWT.VERTICAL ? SWT.HORIZONTAL : SWT.VERTICAL; for (int i = 0; i < sashes.length; i++) { sashes[i].dispose(); - sashes[i] = new Sash(this, sashStyle); - sashes[i].setBackground(background); - sashes[i].setForeground(foreground); - sashes[i].addListener(SWT.Selection, sashListener); + sashes[i] = createSash(); } layout(false); } diff --git a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashFormLayout.java b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashFormLayout.java index 3f1842fa54..b70a30f3fc 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashFormLayout.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Custom Widgets/common/org/eclipse/swt/custom/SashFormLayout.java @@ -112,10 +112,7 @@ protected void layout(Composite composite, boolean flushCache) { Sash[] newSashes = new Sash[controls.length - 1]; System.arraycopy(sashForm.sashes, 0, newSashes, 0, sashForm.sashes.length); for (int i = sashForm.sashes.length; i < newSashes.length; i++) { - newSashes[i] = new Sash(sashForm, sashForm.sashStyle); - newSashes[i].setBackground(sashForm.background); - newSashes[i].setForeground(sashForm.foreground); - newSashes[i].addListener(SWT.Selection, sashForm.sashListener); + newSashes[i] = sashForm.createSash(); } sashForm.sashes = newSashes; } |