本文整理汇总了Java中javax.swing.plaf.TableUI类的典型用法代码示例。如果您正苦于以下问题:Java TableUI类的具体用法?Java TableUI怎么用?Java TableUI使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TableUI类属于javax.swing.plaf包,在下文中一共展示了TableUI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
@Override
public void setUI( TableUI ui ) {
JBroTableUI oldUI = getUI();
if ( oldUI != null || ui instanceof JBroTableUI ) {
super.setUI( ui );
if ( !( ui instanceof JBroTableUI ) ) {
if ( ui != null )
ui.uninstallUI( this );
this.ui = oldUI;
oldUI.setNoDefaults( true );
oldUI.installUI( this );
oldUI.setNoDefaults( false );
firePropertyChange( "UI", ui, oldUI );
refresh();
}
}
}
示例2: getUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
/**
* Maps {@code JTable.getUI()} through queue
*/
public TableUI getUI() {
return (runMapping(new MapAction<TableUI>("getUI") {
@Override
public TableUI map() {
return ((JTable) getSource()).getUI();
}
}));
}
示例3: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
/**
* Maps {@code JTable.setUI(TableUI)} through queue
*/
public void setUI(final TableUI tableUI) {
runMapping(new MapVoidAction("setUI") {
@Override
public void map() {
((JTable) getSource()).setUI(tableUI);
}
});
}
示例4: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
/**
* This method sets the table's UI delegate.
*
* @param ui The table's UI delegate.
*/
public void setUI(TableUI ui)
{
super.setUI(ui);
// The editors and renderers must be recreated because they constructors
// may use the look and feel properties.
createDefaultEditors();
createDefaultRenderers();
}
示例5: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
/**
* Standard JTable's UI has non convenient keybinding for
* editing. Therefore we have to replace some standard actions.
*/
public void setUI(final TableUI ui){
super.setUI(ui);
// Customize action and input maps
@NonNls final ActionMap actionMap=getActionMap();
@NonNls final InputMap focusedInputMap=getInputMap(JComponent.WHEN_FOCUSED);
@NonNls final InputMap ancestorInputMap=getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
actionMap.put("selectPreviousRow",new MySelectPreviousRowAction());
actionMap.put("selectNextRow",new MySelectNextRowAction());
actionMap.put("startEditing",new MyStartEditingAction());
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F2,0),"startEditing");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_F2,0));
actionMap.put("smartEnter",new MyEnterAction());
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0),"smartEnter");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER,0));
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),"cancel");
ancestorInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE,0),"cancel");
actionMap.put("expandCurrent", new MyExpandCurrentAction(true));
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0),"expandCurrent");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ADD,0));
actionMap.put("collapseCurrent", new MyExpandCurrentAction(false));
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0),"collapseCurrent");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT,0));
}
示例6: updateUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
public void updateUI() {
// Update the UI of the table header
if (tableHeader != null && tableHeader.getParent() == null) {
tableHeader.updateUI();
}
setUI((TableUI) UIManager.getUI(this));
}
示例7: testGetSetUpdateUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
public void testGetSetUpdateUI() throws Exception {
assertTrue(table.getUI() instanceof BasicTableUI);
TableUI ui = new BasicTableUI();
table.setUI(ui);
assertSame(ui, table.getUI());
table.updateUI();
assertNotSame(ui, table.getUI());
}
示例8: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
/**
* Morten Alver: This override is a workaround NullPointerException when
* dragging stuff into the table. I found this in a forum, but have no idea
* why it works.
* @param newUI
*/
@Override
public void setUI(TableUI newUI) {
super.setUI(newUI);
TransferHandler handler = getTransferHandler();
setTransferHandler(null);
setTransferHandler(handler);
}
示例9: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
/**
* Standard JTable's UI has non convenient keybinding for
* editing. Therefore we have to replace some standard actions.
*/
@Override
public void setUI(final TableUI ui)
{
super.setUI(ui);
// Customize action and input maps
@NonNls final ActionMap actionMap = getActionMap();
@NonNls final InputMap focusedInputMap = getInputMap(JComponent.WHEN_FOCUSED);
@NonNls final InputMap ancestorInputMap = getInputMap(JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT);
actionMap.put("selectPreviousRow", new MySelectPreviousRowAction());
actionMap.put("selectNextRow", new MySelectNextRowAction());
actionMap.put("startEditing", new MyStartEditingAction());
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0), "startEditing");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_F2, 0));
actionMap.put("smartEnter", new MyEnterAction());
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0), "smartEnter");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ENTER, 0));
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel");
ancestorInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ESCAPE, 0), "cancel");
actionMap.put("expandCurrent", new MyExpandCurrentAction(true));
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0), "expandCurrent");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_ADD, 0));
actionMap.put("collapseCurrent", new MyExpandCurrentAction(false));
focusedInputMap.put(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0), "collapseCurrent");
ancestorInputMap.remove(KeyStroke.getKeyStroke(KeyEvent.VK_SUBTRACT, 0));
}
示例10: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
@Override
public void setUI(TableUI ui) {
super.setUI(ui);
renderer = null;
sheetCellEditor = null;
}
示例11: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
public void setUI(TableUI ui) {
needCalcRowHeight = true;
inSetUI = true;
super.setUI(ui);
inSetUI = false;
}
示例12: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
@Override
public void setUI( TableUI ui ) {
super.setUI( new TabTableUI() );
}
示例13: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
@Override
public void setUI( TableUI ui ) {
super.setUI( new TaskListTableUI() );
setTableHeader( createDefaultTableHeader() );
}
示例14: getUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
public TableUI getUI() {
AndroidClassUtil.callEmptyMethod();
return null;
}
示例15: setUI
import javax.swing.plaf.TableUI; //导入依赖的package包/类
public void setUI(TableUI ui) {
AndroidClassUtil.callEmptyMethod();
}