/**
* Created on Oct 9, 2007
* Copyright 2005 CafeSip.org
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.cafesip.jiplet.console.client;
import org.cafesip.gwtcomp.client.ui.MessageBar;
import org.cafesip.gwtcomp.client.ui.SuperTable;
import org.cafesip.gwtcomp.client.ui.TitleBar;
import com.google.gwt.user.client.ui.FlowPanel;
/**
* @author Amit Chatterjee
*
*/
public class TablePanel extends FlowPanel
{
private TitleBar titleBar;
private SuperTable table;
private MessageBar messageBar;
public TablePanel()
{
setWidth("100%");
titleBar = new TitleBar("[Title]", null, 2);
add(titleBar);
titleBar.setWidth("100%");
messageBar = new MessageBar();
add(messageBar);
messageBar.setWidth("100%");
}
/**
* @return Returns the titleBar.
*/
public TitleBar getTitleBar()
{
return titleBar;
}
/**
* @return Returns the table.
*/
public SuperTable getTable()
{
return table;
}
/**
* @param table
* The table to set.
*/
public void setTable(SuperTable table)
{
removeTable();
this.table = table;
add(table);
table.setWidth("100%");
}
/**
*
*/
public void removeTable()
{
if (table != null)
{
remove(table);
table = null;
}
}
/**
* @return Returns the messageBar.
*/
public MessageBar getMessageBar()
{
return messageBar;
}
public void setTableVisible(boolean visible)
{
table.setVisible(visible);
}
}