X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.views.swt.client%2Fsrc%2Forg%2Fsimantics%2Fviews%2Fswt%2Fclient%2Fimpl%2FSWTSashForm.java;h=fe1d2565f15ee35d733a7a68a64c0d853021be29;hp=af79bdc8d04aa389b93cf1891b95b57eee6b9231;hb=refs%2Fchanges%2F38%2F238%2F2;hpb=24e2b34260f219f0d1644ca7a138894980e25b14 diff --git a/bundles/org.simantics.views.swt.client/src/org/simantics/views/swt/client/impl/SWTSashForm.java b/bundles/org.simantics.views.swt.client/src/org/simantics/views/swt/client/impl/SWTSashForm.java index af79bdc8d..fe1d2565f 100644 --- a/bundles/org.simantics.views.swt.client/src/org/simantics/views/swt/client/impl/SWTSashForm.java +++ b/bundles/org.simantics.views.swt.client/src/org/simantics/views/swt/client/impl/SWTSashForm.java @@ -1,48 +1,48 @@ -package org.simantics.views.swt.client.impl; - -import org.eclipse.swt.custom.SashForm; -import org.eclipse.swt.widgets.Control; -import org.eclipse.swt.widgets.Sash; -import org.simantics.views.ViewUtils.LayoutBean; -import org.simantics.views.swt.client.base.SWTViewUtils; -import org.simantics.views.swt.client.base.SingleSWTViewNode; - -public class SWTSashForm extends SingleSWTViewNode { - - private static final long serialVersionUID = 7932335224632082902L; - - public LayoutBean layout; - public int[] weights; - public Integer orientation; - - @Override - public void createControls(org.eclipse.swt.widgets.Composite parent) { - - control = new SashForm(parent, style); - - createChildComposites(); - - setProperties(); - - } - - final public void synchronizeLayout(LayoutBean layout) { - if(layout != null) control.setLayout(SWTViewUtils.toLayout(layout)); - } - - final public void synchronizeWeights(int[] weights) { - if(weights != null) { - int childCount = 0; - for(Control c : control.getChildren()) { - if (c instanceof Sash) continue; - childCount++; - } - if(weights.length != childCount) throw new IllegalStateException("Got " + weights.length + " weights, but had " + childCount + " children."); - control.setWeights(weights); - } - } - final public void synchronizeOrientation(Integer orientation) { - if(orientation != null) control.setOrientation(orientation); - } - -} +package org.simantics.views.swt.client.impl; + +import org.eclipse.swt.custom.SashForm; +import org.eclipse.swt.widgets.Control; +import org.eclipse.swt.widgets.Sash; +import org.simantics.views.ViewUtils.LayoutBean; +import org.simantics.views.swt.client.base.SWTViewUtils; +import org.simantics.views.swt.client.base.SingleSWTViewNode; + +public class SWTSashForm extends SingleSWTViewNode { + + private static final long serialVersionUID = 7932335224632082902L; + + public LayoutBean layout; + public int[] weights; + public Integer orientation; + + @Override + public void createControls(org.eclipse.swt.widgets.Composite parent) { + + control = new SashForm(parent, style); + + createChildComposites(); + + setProperties(); + + } + + final public void synchronizeLayout(LayoutBean layout) { + if(layout != null) control.setLayout(SWTViewUtils.toLayout(layout)); + } + + final public void synchronizeWeights(int[] weights) { + if(weights != null) { + int childCount = 0; + for(Control c : control.getChildren()) { + if (c instanceof Sash) continue; + childCount++; + } + if(weights.length != childCount) throw new IllegalStateException("Got " + weights.length + " weights, but had " + childCount + " children."); + control.setWeights(weights); + } + } + final public void synchronizeOrientation(Integer orientation) { + if(orientation != null) control.setOrientation(orientation); + } + +}