List of usage examples for com.google.gwt.user.client.ui VerticalPanel setSpacing
public void setSpacing(int spacing)
From source file:client.argon.page.ArgonEndpointCreatePage.java
License:Open Source License
private final Widget getEditPanel() { final VerticalPanel outerPanel = new VerticalPanel(); final FlexTable table = new FlexTable(); outerPanel.setSpacing(5); final Label labelSource = new Label(); labelSource.setText("SourceNode: "); table.setWidget(0, 0, labelSource);/* ww w .jav a 2 s. c o m*/ table.setWidget(0, 1, this.sourceNode); final Label labelDestination = new Label(); labelDestination.setText("DestinationNode: "); table.setWidget(1, 0, labelDestination); table.setWidget(1, 1, this.destinationNode); final Label labelOutgoing = new Label(); labelOutgoing.setText("Outgoing Interface: "); table.setWidget(2, 0, labelOutgoing); table.setWidget(2, 1, this.outgoingInterface); final Label labelIngoing = new Label(); labelIngoing.setText("Ingoing Interface: "); table.setWidget(3, 0, labelIngoing); table.setWidget(3, 1, this.ingoingInterface); final Label labelBw = new Label(); labelBw.setText("Bandwidth: "); this.bandwidth.setText("0"); table.setWidget(4, 0, labelBw); table.setWidget(4, 1, this.bandwidth); final Label labelValidFrom = new Label(); labelValidFrom.setText("Valid From: "); table.setWidget(5, 0, labelValidFrom); this.validFrom.setText(this.dateTimeFormat.format(new Date())); table.setWidget(5, 1, this.validFrom); final Label labelValidTo = new Label(); labelValidTo.setText("Valid To: "); this.validTo.setText(this.dateTimeFormat.format(new Date())); table.setWidget(6, 0, labelValidTo); table.setWidget(6, 1, this.validTo); final Label labelLinkUp = new Label(); labelLinkUp.setText("Link Up: "); table.setWidget(7, 0, labelLinkUp); this.linkUp.addItem("true"); this.linkUp.addItem("false"); table.setWidget(7, 1, this.linkUp); final Label labelDelay = new Label(); labelDelay.setText("Delay: "); this.delay.setText("0"); table.setWidget(8, 0, labelDelay); table.setWidget(8, 1, this.delay); this.button.addClickListener(this); this.button.setText("Create"); table.setWidget(9, 0, this.button); table.setWidget(9, 1, this.activity); // table.getFlexCellFormatter().setColSpan(3, 1, 3); return table; }
From source file:client.argon.page.ArgonRouterCreatePage.java
License:Open Source License
private final Widget getEditPanel() { final VerticalPanel outerPanel = new VerticalPanel(); final FlexTable table = new FlexTable(); outerPanel.setSpacing(5); final Label labelLoopB = new Label(); labelLoopB.setText("LoopBack: "); table.setWidget(0, 0, labelLoopB);//from ww w . ja va 2s . c o m table.setWidget(0, 1, this.loopBackAd); // final Label labelConfig = new Label(); labelConfig.setText("Configuration: "); table.setWidget(1, 0, labelConfig); table.setWidget(1, 1, this.configAd); // final Label labelType = new Label(); labelType.setText("Type: "); table.setWidget(2, 0, labelType); table.setWidget(2, 1, this.type); this.button.addClickListener(this); this.button.setText("Create"); table.setWidget(3, 0, this.button); table.setWidget(3, 1, this.activity); // table.getFlexCellFormatter().setColSpan(3, 1, 3); return table; }
From source file:com.allen_sauer.gwt.dnd.demo.client.example.draghandle.DragHandleExample.java
License:Apache License
public DragHandleExample(DemoDragHandler demoDragHandler) { addStyleName(CSS_DEMO_DRAG_HANDLE_EXAMPLE); // use the boundary panel as this composite's widget final AbsolutePanel boundaryPanel = new AbsolutePanel(); boundaryPanel.setPixelSize(600, 400); setWidget(boundaryPanel);/*from ww w. java2 s.co m*/ // create the title bar HTML header = new HTML( "Title/Header (Drag Handle) with <a href='http://google.com/' target='_blank'>link</a>"); header.addStyleName(CSS_DEMO_DRAG_HANDLE_EXAMPLE_HEADER); // add some text HTML content = new HTML("This is a <code>VerticalPanel</code> which can be dragged by its header," + " i.e. the title/header widget."); // add an editable text area final TextArea textArea = new TextArea(); textArea.addStyleName(CSS_DEMO_DRAG_HANDLE_EXAMPLE_TEXTAREA); // textArea.setSize("20em", "5em"); textArea.setText("You can click in this TextArea to get focus without causing the panel to be dragged."); // add a clickable button Button button = new Button("Click me"); button.addClickHandler(new ClickHandler() { @Override public void onClick(ClickEvent event) { textArea.setText(textArea.getText() + " Click!"); } }); // create a panel to hold all our widgets VerticalPanel verticalPanel = new VerticalPanel(); verticalPanel.setSpacing(2); verticalPanel.addStyleName(CSS_DEMO_DRAG_HANDLE_EXAMPLE_PANEL); verticalPanel.add(header); verticalPanel.add(content); verticalPanel.add(textArea); verticalPanel.add(button); boundaryPanel.add(verticalPanel, 20, 20); // instantiate our drag controller dragController = new PickupDragController(boundaryPanel, true); dragController.addDragHandler(demoDragHandler); dragController.setBehaviorConstrainedToBoundaryPanel(true); dragController.setBehaviorMultipleSelection(false); dragController.setBehaviorDragStartSensitivity(5); // instantiate our drop controller AbsolutePositionDropController dropController = new AbsolutePositionDropController(boundaryPanel); dragController.registerDropController(dropController); // make the panel draggable by its header dragController.makeDraggable(verticalPanel, header); }
From source file:com.allen_sauer.gwt.dnd.demo.client.example.insertpanel.InsertPanelExample.java
License:Apache License
public InsertPanelExample(DemoDragHandler demoDragHandler) { addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE); int count = 0; // use the boundary panel as this composite's widget AbsolutePanel boundaryPanel = new AbsolutePanel(); boundaryPanel.setSize("100%", "100%"); setWidget(boundaryPanel);//from w w w . java 2s. c o m // initialize our column drag controller PickupDragController columnDragController = new PickupDragController(boundaryPanel, false); columnDragController.setBehaviorMultipleSelection(false); columnDragController.addDragHandler(demoDragHandler); // initialize our widget drag controller PickupDragController widgetDragController = new PickupDragController(boundaryPanel, false); widgetDragController.setBehaviorMultipleSelection(false); widgetDragController.addDragHandler(demoDragHandler); // initialize horizontal panel to hold our columns HorizontalPanel horizontalPanel = new HorizontalPanel(); horizontalPanel.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_CONTAINER); horizontalPanel.setSpacing(SPACING); boundaryPanel.add(horizontalPanel); // initialize our column drop controller HorizontalPanelDropController columnDropController = new HorizontalPanelDropController(horizontalPanel); columnDragController.registerDropController(columnDropController); for (int col = 1; col <= COLUMNS; col++) { // initialize a vertical panel to hold the heading and a second vertical // panel VerticalPanel columnCompositePanel = new VerticalPanel(); columnCompositePanel.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_COLUMN_COMPOSITE); // initialize inner vertical panel to hold individual widgets VerticalPanel verticalPanel = new VerticalPanelWithSpacer(); verticalPanel.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_CONTAINER); verticalPanel.setSpacing(SPACING); horizontalPanel.add(columnCompositePanel); // initialize a widget drop controller for the current column VerticalPanelDropController widgetDropController = new VerticalPanelDropController(verticalPanel); widgetDragController.registerDropController(widgetDropController); // Put together the column pieces Label heading = new Label("Column " + col); heading.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_HEADING); columnCompositePanel.add(heading); columnCompositePanel.add(verticalPanel); // make the column draggable by its heading columnDragController.makeDraggable(columnCompositePanel, heading); for (int row = 1; row <= ROWS; row++) { // initialize a widget HTML widget = new HTML("Draggable #" + ++count); widget.addStyleName(CSS_DEMO_INSERT_PANEL_EXAMPLE_WIDGET); widget.setHeight(Random.nextInt(4) + 2 + "em"); verticalPanel.add(widget); // make the widget draggable widgetDragController.makeDraggable(widget); } } }
From source file:com.audata.client.admin.ClassificationPanel.java
License:Open Source License
/** * Public constructor of Classification/*ww w . j a va 2 s . co m*/ * Admin panel * */ public ClassificationPanel() { this.setSpacing(5); this.setSize("100%", "100%"); // add section title Label l = new Label(LANG.classification_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); hp.setSize("100%", "100%"); // add classification browser this.classBrowser = new ClassBrowser("100%", "100%"); this.classBrowser.onUpdate(); this.classBrowser.classes.addTreeListener(this); this.classBrowser.setStyleName("audoc-browser"); this.classBrowser.setSize("100%", "100%"); hp.add(this.classBrowser); // form VerticalPanel vp = new VerticalPanel(); vp.addStyleName("audoc-form"); vp.setSpacing(5); // name field HorizontalPanel namePanel = new HorizontalPanel(); namePanel.setSpacing(5); Label n = new Label(LANG.name_Text()); n.setWidth("100px"); namePanel.add(n); this.name = new TextBox(); namePanel.add(this.name); vp.add(namePanel); // retention field HorizontalPanel retPanel = new HorizontalPanel(); retPanel.setSpacing(5); Label r = new Label(LANG.retention_Text()); r.setWidth("100px"); retPanel.add(r); this.retention = new NumericTextBox(); retPanel.add(this.retention); vp.add(retPanel); // security level field HorizontalPanel secPanel = new HorizontalPanel(); secPanel.setSpacing(5); Label s = new Label(LANG.security_level_Text()); s.setWidth("100px"); secPanel.add(s); this.secLevel = new ListBox(); secPanel.add(this.secLevel); vp.add(secPanel); // caveats field HorizontalPanel cavPanel = new HorizontalPanel(); cavPanel.setSpacing(5); Label c = new Label(LANG.security_caveat_Text()); c.setWidth("100px"); cavPanel.add(c); this.caveats = new ListBox(); this.caveats.setMultipleSelect(true); this.caveats.setVisibleItemCount(5); cavPanel.add(this.caveats); vp.add(cavPanel); // Buttons HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); butPanel.add(this.save); this.delete = new Button(LANG.delete_Text()); this.delete.addClickListener(this); butPanel.add(this.delete); this.newTop = new Button(LANG.new_Text()); this.newTop.addClickListener(this); butPanel.add(this.newTop); this.newChild = new Button(LANG.new_child_Text()); this.newChild.addClickListener(this); butPanel.add(this.newChild); vp.add(butPanel); // add it all up! hp.add(vp); hp.setCellWidth(this.classBrowser, "100%"); this.add(hp); this.popLists(); }
From source file:com.audata.client.admin.KeywordPanel.java
License:Open Source License
/** * Public Constructor//ww w . ja v a 2 s. co m * */ public KeywordPanel() { this.setSpacing(5); this.setSize("100%", "100%"); // add section title Label l = new Label(LANG.admin_keyword_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel kwhs = new HorizontalPanel(); kwhs.setSpacing(5); Label kl = new Label(LANG.keyword_hierarchy_Text()); kwhs.add(kl); this.hierarchies = new ListBox(); this.hierarchies.setWidth("150px"); this.hierarchies.setVisibleItemCount(1); this.hierarchies.addChangeListener(this); kwhs.add(this.hierarchies); this.newHierarchy = new Button(LANG.new_Text()); this.newHierarchy.addClickListener(this); kwhs.add(this.newHierarchy); this.delHierarchy = new Button(LANG.delete_Text()); this.delHierarchy.addClickListener(this); kwhs.add(this.delHierarchy); this.add(kwhs); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(10); hp.setSize("100%", "100%"); // add classification browser this.keywordBrowser = new KeywordBrowser("100%", "100%"); this.keywordBrowser.keywords.addTreeListener(this); this.keywordBrowser.setStyleName("audoc-browser"); this.keywordBrowser.setSize("100%", "100%"); hp.add(this.keywordBrowser); hp.setCellWidth(this.keywordBrowser, "50%"); hp.setCellHeight(this.keywordBrowser, "300px"); // form VerticalPanel vp = new VerticalPanel(); vp.addStyleName("audoc-form"); vp.setSpacing(5); // name field HorizontalPanel namePanel = new HorizontalPanel(); namePanel.setSpacing(5); Label n = new Label(LANG.name_Text()); n.setWidth("100px"); namePanel.add(n); this.name = new TextBox(); namePanel.add(this.name); vp.add(namePanel); // Buttons HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.save = new Button(LANG.save_Text()); this.save.addClickListener(this); butPanel.add(this.save); this.delete = new Button(LANG.delete_Text()); this.delete.addClickListener(this); butPanel.add(this.delete); this.newTop = new Button(LANG.new_Text()); this.newTop.addClickListener(this); butPanel.add(this.newTop); this.newChild = new Button(LANG.new_child_Text()); this.newChild.addClickListener(this); butPanel.add(this.newChild); vp.add(butPanel); // add it all up! hp.add(vp); this.add(hp); this.getHierarchies(); }
From source file:com.audata.client.admin.NewHierarchy.java
License:Open Source License
/** * Public Constructor which take the parent admin panel * so that it can be updated when a new Hierarchy has * been added/* w w w . j a v a 2s . c om*/ * @param parent The parent KeywordPanel */ public NewHierarchy(KeywordPanel parent) { this.parent = parent; this.setText(LANG.new_keyword_hierarchy_Text()); VerticalPanel main = new VerticalPanel(); main.setSpacing(4); HorizontalPanel fields = new HorizontalPanel(); fields.setSpacing(4); Label l = new Label(LANG.name_Text()); this.name = new TextBox(); this.name.setWidth("150px"); fields.add(l); fields.add(this.name); main.add(fields); HorizontalPanel buttons = new HorizontalPanel(); buttons.setSpacing(4); this.ok = new Button(LANG.save_Text()); this.ok.addClickListener(this); this.cancel = new Button(LANG.cancel_Text()); this.cancel.addClickListener(this); buttons.add(this.ok); buttons.add(this.cancel); main.add(buttons); this.setWidget(main); }
From source file:com.audata.client.admin.RecTypePanel.java
License:Open Source License
/** * Constructor for the PecTypePanel./* w w w . ja v a 2 s. c o m*/ * Builds the UI and gets the content of the * list. */ public RecTypePanel() { this.selectedUUID = null; this.setSize("100%", "100%"); this.setSpacing(5); Label title = new Label(LANG.admin_rectypes_Text()); title.addStyleName("audoc-sectionTitle"); this.add(title); HorizontalPanel hp = new HorizontalPanel(); hp.setSpacing(5); String template = "<p><span class=\"audoc-rectype-title\">#0</span><br/>" + "<span class=\"audoc-rectype-notes\">#1</span></p>"; this.recTypes = new HTMLButtonList("images/48x48/rectypes.gif", template, false); this.recTypes.addStyleName("audoc-recTypes"); this.recTypes.addClickListener(this); this.recTypes.setPixelSize(300, 300); hp.add(this.recTypes); VerticalPanel form = new VerticalPanel(); form.setSpacing(5); form.addStyleName("audoc-form"); HorizontalPanel namePanel = new HorizontalPanel(); Label nameLabel = new Label(LANG.name_Text()); nameLabel.setWidth("100px"); namePanel.add(nameLabel); this.nameBox = new TextBox(); namePanel.add(this.nameBox); form.add(namePanel); HorizontalPanel descPanel = new HorizontalPanel(); Label descLabel = new Label(LANG.description_Text()); descLabel.setWidth("100px"); descPanel.add(descLabel); this.descBox = new TextArea(); descPanel.add(this.descBox); form.add(descPanel); HorizontalPanel udfPanel = new HorizontalPanel(); Label udfLabel = new Label(LANG.udf_Text()); udfLabel.setWidth("100px"); udfPanel.add(udfLabel); this.udfsBox = new ListBox(); this.udfsBox.setVisibleItemCount(5); this.udfsBox.setMultipleSelect(true); udfPanel.add(this.udfsBox); form.add(udfPanel); HorizontalPanel butPanel = new HorizontalPanel(); butPanel.setSpacing(5); this.newBut = new Button(LANG.new_Text()); this.newBut.addClickListener(this); butPanel.add(this.newBut); this.saveBut = new Button(LANG.save_Text()); this.saveBut.addClickListener(this); butPanel.add(this.saveBut); this.delBut = new Button(LANG.delete_Text()); this.delBut.addClickListener(this); butPanel.add(this.delBut); form.add(butPanel); hp.add(form); this.add(hp); this.getRecTypes(); this.getUDFs(); }
From source file:com.audata.client.admin.ReportingPanel.java
License:Open Source License
/** * public contrcutor//from w w w .j a v a2s . c o m */ public ReportingPanel() { this.uuid = ""; this.setSize("100%", "100%"); //section title Label l = new Label(LANG.reports_Text()); l.addStyleName("audoc-sectionTitle"); this.add(l); HorizontalPanel main = new HorizontalPanel(); main.setSpacing(5); //Reports list String rTemplate = "<span class=\"audoc-report-title\">#0</span><br/><span class=\"audoc-report-template\">#1</span><br/><span class=\"audoc-report-criteria\">#2</span>"; this.reports = new HTMLButtonList("images/48x48/reports.gif", rTemplate, false); this.reports.addClickListener(this); this.reports.addStyleName("audoc-udfs"); this.reports.setPixelSize(300, 300); main.add(this.reports); //Form VerticalPanel formPanel = new VerticalPanel(); formPanel.setSpacing(4); HorizontalPanel tPanel = new HorizontalPanel(); Label titleLabel = new Label(LANG.title_Text()); titleLabel.setWidth("100px"); tPanel.add(titleLabel); this.title = new TextBox(); tPanel.add(this.title); formPanel.add(tPanel); HorizontalPanel tempPanel = new HorizontalPanel(); Label tempLabel = new Label(LANG.template_Text()); tempLabel.setWidth("100px"); tempPanel.add(tempLabel); this.template = new TextBox(); tempPanel.add(this.template); formPanel.add(tempPanel); HorizontalPanel cPanel = new HorizontalPanel(); Label cLabel = new Label(LANG.criteria_Text()); cLabel.setWidth("100px"); cPanel.add(cLabel); this.criteria = new TextArea(); this.criteria.setVisibleLines(5); cPanel.add(this.criteria); formPanel.add(cPanel); HorizontalPanel bPanel = new HorizontalPanel(); bPanel.setSpacing(5); this.newButton = new Button(LANG.new_Text()); this.newButton.addClickListener(this); bPanel.add(this.newButton); this.saveButton = new Button(LANG.save_Text()); this.saveButton.addClickListener(this); bPanel.add(this.saveButton); this.delButton = new Button(LANG.delete_Text()); this.delButton.addClickListener(this); bPanel.add(this.delButton); formPanel.add(bPanel); main.add(formPanel); this.add(main); this.onUpdate(); }
From source file:com.audata.client.admin.SecurityPanel.java
License:Open Source License
/** * Creates SecLevel panel/*w w w. j ava 2 s.c om*/ * @return VerticalPanel containing SecLevel admin features */ private VerticalPanel buildLevelPanel() { VerticalPanel lp = new VerticalPanel(); lp.setSpacing(5); lp.addStyleName("audoc-group"); Label levelTitle = new Label(LANG.security_levels_Text()); levelTitle.addStyleName("audoc-sectionTitle"); String levelCaption = "<span class=\"secLevel-title\">#1</span><br/>" + "<span class=\"secLevel-level\">" + LANG.level_Text() + ": #0</span>"; this.levelList = new HTMLButtonList("images/48x48/security.gif", levelCaption, false); this.levelList.addStyleName("audoc-levels"); this.levelList.addClickListener(new SecLevelClickListener(this)); this.levelList.setPixelSize(250, 200); lp.add(levelTitle); lp.add(this.levelList); HorizontalPanel namePanel = new HorizontalPanel(); Label nameLabel = new Label(LANG.name_Text()); nameLabel.setWidth("100px"); nameLabel.addStyleName("audoc-label"); this.levelNameBox = new TextBox(); namePanel.add(nameLabel); namePanel.add(this.levelNameBox); lp.add(namePanel); HorizontalPanel levelPanel = new HorizontalPanel(); Label levelLabel = new Label(LANG.level_Text()); levelLabel.setWidth("100px"); levelLabel.addStyleName("audoc-label"); this.levelBox = new TextBox(); levelPanel.add(levelLabel); levelPanel.add(this.levelBox); lp.add(levelPanel); HorizontalPanel buttonPanel = new HorizontalPanel(); buttonPanel.setSpacing(5); this.newLevButton = new Button(LANG.new_Text()); this.newLevButton.addClickListener(this); this.saveLevButton = new Button(LANG.save_Text()); this.saveLevButton.addClickListener(this); this.delLevButton = new Button(LANG.delete_Text()); this.delLevButton.addClickListener(this); buttonPanel.add(this.newLevButton); buttonPanel.add(this.saveLevButton); buttonPanel.add(this.delLevButton); lp.add(buttonPanel); return lp; }