org.wings.template.propertymanagers.STablePropertyManager Maven / Gradle / Ivy
The newest version!
/*
* Copyright 2000,2005 wingS development team.
*
* This file is part of wingS (http://wingsframework.org).
*
* wingS is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1
* of the License, or (at your option) any later version.
*
* Please see COPYING for the complete licence.
*/
package org.wings.template.propertymanagers;
import org.wings.SComponent;
import org.wings.SDimension;
import org.wings.STable;
import org.wings.template.propertymanagers.SComponentPropertyManager;
import java.awt.*;
/**
* @author Armin Haaf
*/
public class STablePropertyManager
extends SComponentPropertyManager {
static final Class[] classes = {STable.class};
public STablePropertyManager() {
}
@Override
public void setProperty(SComponent comp, String name, String value) {
STable t = (STable) comp;
switch (name) {
case "GRID":
t.setShowGrid(Boolean.valueOf(value));
break;
case "CELLSPACING":
t.setIntercellSpacing(new SDimension(value, value));
break;
case "CELLPADDING":
t.setIntercellPadding(new SDimension(value, value));
break;
case "SELECTION_FOREGROUND":
t.setSelectionForeground(Color.decode(value));
break;
case "SELECTION_BACKGROUND":
t.setSelectionBackground(Color.decode(value));
break;
default:
super.setProperty(comp, name, value);
break;
}
}
@Override
public Class[] getSupportedClasses() {
return classes;
}
}