|
| 1 | +/******************************************************************************** |
| 2 | + * Copyright (c) 2019-2020 [Open Lowcode SAS](https://openlowcode.com/) |
| 3 | + * |
| 4 | + * This program and the accompanying materials are made available under the |
| 5 | + * terms of the Eclipse Public License 2.0 which is available at |
| 6 | + * http://www.eclipse.org/legal/epl-2.0 . |
| 7 | + * |
| 8 | + * SPDX-License-Identifier: EPL-2.0 |
| 9 | + ********************************************************************************/ |
| 10 | + |
| 11 | +package org.openlowcode.client.graphic.widget; |
| 12 | + |
| 13 | +import java.io.IOException; |
| 14 | + |
| 15 | +import org.openlowcode.client.graphic.CPageData; |
| 16 | +import org.openlowcode.client.graphic.CPageNode; |
| 17 | +import org.openlowcode.client.graphic.CPageSignifPath; |
| 18 | +import org.openlowcode.client.graphic.Callback; |
| 19 | +import org.openlowcode.client.runtime.PageActionManager; |
| 20 | +import org.openlowcode.tools.messages.MessageReader; |
| 21 | +import org.openlowcode.tools.messages.OLcRemoteException; |
| 22 | +import org.openlowcode.tools.structure.DataElt; |
| 23 | +import org.openlowcode.tools.structure.DataEltType; |
| 24 | + |
| 25 | +import javafx.scene.Node; |
| 26 | +import javafx.scene.control.TabPane; |
| 27 | +import javafx.scene.paint.Color; |
| 28 | +import javafx.scene.shape.Rectangle; |
| 29 | +import javafx.stage.Window; |
| 30 | + |
| 31 | +/** |
| 32 | + * The width protector ensures a component band will have at least the width |
| 33 | + * specified here |
| 34 | + * |
| 35 | + * @author <a href="https://openlowcode.com/" rel="nofollow">Open Lowcode |
| 36 | + * SAS</a> |
| 37 | + * @since 1.11 |
| 38 | + */ |
| 39 | +public class CWidthProtector |
| 40 | + extends |
| 41 | + CPageNode { |
| 42 | + |
| 43 | + private int minwidth; |
| 44 | + |
| 45 | + public CWidthProtector(MessageReader reader, CPageSignifPath parentpath) throws OLcRemoteException, IOException { |
| 46 | + super(reader, parentpath); |
| 47 | + minwidth = reader.returnNextIntegerField("MNW"); |
| 48 | + reader.returnNextEndStructure("WDP"); |
| 49 | + } |
| 50 | + |
| 51 | + @Override |
| 52 | + public CPageNode deepcopyWithCallback(Callback callback) { |
| 53 | + throw new RuntimeException("Not yet implemented"); |
| 54 | + |
| 55 | + } |
| 56 | + |
| 57 | + @Override |
| 58 | + public Node getNode( |
| 59 | + PageActionManager actionmanager, |
| 60 | + CPageData inputdata, |
| 61 | + Window parentwindow, |
| 62 | + TabPane[] parenttabpanes, |
| 63 | + CollapsibleNode nodetocollapsewhenactiontriggered) { |
| 64 | + Rectangle rectangle = new Rectangle(minwidth,0,Color.RED); |
| 65 | + return rectangle; |
| 66 | + } |
| 67 | + |
| 68 | + @Override |
| 69 | + public DataElt getDataElt(DataEltType type, String eltname, String objectdataloc) { |
| 70 | + |
| 71 | + return null; |
| 72 | + } |
| 73 | + |
| 74 | + @Override |
| 75 | + public void forceUpdateData(DataElt dataelt) { |
| 76 | + |
| 77 | + |
| 78 | + } |
| 79 | + |
| 80 | + @Override |
| 81 | + public void mothball() { |
| 82 | + |
| 83 | + } |
| 84 | + |
| 85 | +} |
0 commit comments