Commit 37fef94d authored by Sonia Zorba's avatar Sonia Zorba
Browse files

Refactoring

parent 646a3c57
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -7,7 +7,7 @@ Wicket libraries used to compile TAP Schema Manager:
5) Wicket 1.6.0 - wicket-extensions-6.0.0.jar
6) Wicket 1.6.0 - wicket-ioc-6.0.0.jar
7) Wicket 1.6.0 - wicket-request-6.0.0.jar
8) Wicket 1.6.0  wicket-util-6.0.0.jar
8) Wicket 1.6.0 - wicket-util-6.0.0.jar

Instructions on how to install the 1.6.0 Wicket libraries are at the following link:

+8 −1
Original line number Diff line number Diff line
@@ -5,13 +5,20 @@
        <meta name="description" content="Put your description here!" /> 
    <wicket:head> 
        <wicket:link> 
            <link rel="stylesheet" type="text/css" href="style.css"/> 
            <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/> 
            <link rel="stylesheet" type="text/css" href="css/style.css"/> 
        </wicket:link> 
    </wicket:head> 
</head> 
<body>
    <!--<header wicket:id="headerpanel" />-->
    <div class="text-center">
        <h1 wicket:id="titleLabel"></h1>
    </div>
    <section class="content_container"> 
        <br/>
        <textarea wicket:id="infoTextArea" rows="8" cols="50" class="form-control"></textarea>
        <br/><br/>
        <wicket:child/> 
    </section> 
    <!--<footer wicket:id="footerpanel" />-->
+41 −15
Original line number Diff line number Diff line
/*
 * WicketExamplePage.java
 *
 * Created on 7 gennaio 2013, 8.33
 */
 
package it.inaf.oats.ia2.tap.utils;

import org.apache.wicket.ajax.AjaxRequestTarget;
import org.apache.wicket.markup.html.WebPage;
import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.form.TextArea;
import org.apache.wicket.model.Model;

/**
 *
 * @author pietro
 * @version
 */

public abstract class BasePage extends WebPage {

    public BasePage() { 
    private final TextArea infoTextArea;
    private final Label titleLabel;
    private final String title;

    public BasePage(String title) {
        super();
        //add(new HeaderPanel("headerpanel", "Welcome To Wicket")); 
        //add(new FooterPanel("footerpanel", "Powered by Wicket and the NetBeans Wicket Plugin"));

        try {
            Class.forName("com.mysql.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            e.printStackTrace(System.err);
        }

        infoTextArea = new TextArea("infoTextArea", Model.of(""));
        infoTextArea.setOutputMarkupPlaceholderTag(true);
        infoTextArea.setEnabled(false);
        add(infoTextArea);

        this.title = title;
        titleLabel = new Label("titleLabel", new Model<String>() {
            @Override
            public String getObject() {
                return BasePage.this.title;
            }
        });
        add(titleLabel);
    }

    protected void addInfo(String info) {
        infoTextArea.setModelObject((String) infoTextArea.getModelObject() + "\n" + info);
    }
    protected void addInfo(String info, AjaxRequestTarget target) {
        addInfo(info);
        target.add(infoTextArea);
    }
}
+83 −109
Original line number Diff line number Diff line
<!--
To change this template, choose Tools | Templates
and open the template in the editor.
-->
<!DOCTYPE html>
<html>
    <head>        
        <title></title>
        
            <wicket:head>
                <style type="text/css">
                    body {
                        background-color: lightcyan;
                    }
                    
                    div#container {
                        text-align: center;
                    }
                    
                    table.centered {
                        margin-left: auto;
                        margin-right: auto;
                    }
                    
                    textarea {
                        background-color: lightsteelblue;
                        color: white;
                        font-weight: bold;
                    }
                    
                    input[type="text"] {
                        width: 200px;
                        background-color: lightskyblue;
                        color: white;
                        font-weight: bold;
                    }
                    
                    input[type="password"] {
                        width: 200px;
                        background-color: lightskyblue;
                        color: white;
                        font-weight: bold;
                    }
                    
                    input[type="submit"] {
                        background-color: cornflowerblue;
                        color: white;
                        font-weight: bold;
                    }
                    
                    span.title {
                        font-weight: bold;
                        font-size: 25px;
                    }
                    
                    td.tdlabel {
                        text-align: right;
                        font-weight: bold;
                    }
                </style>
            </wicket:head>
                            
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    </head>
    <body>
    <wicket:extend>
            <div id="container">
                
                <span wicket:id="titleLabel" class="title">Title</span> <br />
        <div class="container">
            <div class="col-sm-10 col-sm-offset-1">
                <div class="panel panel-default">
                    <div class="panel-body">
                        <form wicket:id="credentialForm" class="form-horizontal">
                            <div class="form-group">
                                <label for="hostname" class="col-sm-2 control-label">Hostname</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="hostname" wicket:id="hostname" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="port" class="col-sm-2 control-label">Port</label>
                                <div class="col-sm-10">
                                    <input type="number" class="form-control" id="port" wicket:id="port" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="username" class="col-sm-2 control-label">Username</label>
                                <div class="col-sm-10">
                                    <input type="text" class="form-control" id="username" wicket:id="username" />
                                </div>
                            </div>
                            <div class="form-group">
                                <label for="password" class="col-sm-2 control-label">Password</label>
                                <div class="col-sm-10">
                                    <input type="password" class="form-control" id="password" wicket:id="password" />
                                </div>
                            </div>
                            <div class="form-group">
                                <div class="col-sm-offset-2 col-sm-10">
                                    <input class="btn btn-primary" type="submit" value="Submit credentials" />
                                </div>
                            </div>                            
                        </form>
                    </div>
                </div>
            </div>

                <form wicket:id="credentialForm">
                    <br />
                    <textarea wicket:id="infoTextArea" rows="10" cols="50"></textarea>
                    <br /><br />
            <!--
            <label for="hostnameTextField" wicket:id="hostnameLabel">
                <span wicket:id="hostnameLabel">Hostname</span>
                <input type="text" name="something" id="hostnameTextField" wicket:id="hostnameTextField" />
            </label>
            <table class="centered">
            <tr>
                <td class="tdlabel">
@@ -105,12 +82,9 @@ and open the template in the editor.
                    <input type="password" wicket:id="passwordTextField"  /> <br />
                </td>
            </tr>
                    </table>
                    <br />
                    <input type="submit" wicket:id="credentialSubmit" value="Submit credentials" />
                    <input type="submit" wicket:id="exit" value="Close session" />
                </form>
            
        </table>-->
            <!--<input type="submit" wicket:id="credentialSubmit" value="Submit credentials" />
            <input type="submit" wicket:id="exit" value="Close session" />-->
        </div>
    </wicket:extend>
</body>
+56 −335

File changed.

Preview size limit exceeded, changes collapsed.

Loading