use of org.adempiere.webui.editor.WButtonEditor in project adempiere by adempiere.
the class GridTabListItemRenderer method getEditorCell.
private Listcell getEditorCell(GridField gridField, Object object, int i) {
Listcell cell = new Listcell("", null);
WEditor editor = editors.get(gridField);
if (editor != null) {
if (editor instanceof WButtonEditor) {
Object window = SessionManager.getAppDesktop().findWindow(windowNo);
if (window != null && window instanceof ADWindow) {
AbstractADWindowPanel windowPanel = ((ADWindow) window).getADWindowPanel();
((WButtonEditor) editor).addActionListener(windowPanel);
}
} else {
editor.addValueChangeListener(dataBinder);
}
cell.appendChild(editor.getComponent());
if (editor.getComponent() instanceof Checkbox || editor.getComponent() instanceof Image) {
cell.setStyle("text-align:center");
} else if (DisplayType.isNumeric(gridField.getDisplayType())) {
cell.setStyle("text-align:right");
}
gridField.addPropertyChangeListener(editor);
editor.setValue(gridField.getValue());
WEditorPopupMenu popupMenu = editor.getPopupMenu();
if (popupMenu != null) {
popupMenu.addMenuListener((ContextMenuListener) editor);
cell.appendChild(popupMenu);
}
//streach component to fill grid cell
editor.fillHorizontal();
}
return cell;
}
use of org.adempiere.webui.editor.WButtonEditor in project adempiere by adempiere.
the class GridTabRowRenderer method getEditorCell.
/**
*
* @param gridField
* @param object
* @param i
* @return
*/
private WEditor getEditorCell(GridField gridField, Object object, int i) {
WEditor editor = editors.get(gridField);
if (editor != null) {
if (editor instanceof WButtonEditor) {
if (m_windowPanel != null) {
((WButtonEditor) editor).addActionListener(m_windowPanel);
} else {
Object window = SessionManager.getAppDesktop().findWindow(windowNo);
if (window != null && window instanceof ADWindow) {
AbstractADWindowPanel windowPanel = ((ADWindow) window).getADWindowPanel();
((WButtonEditor) editor).addActionListener(windowPanel);
}
}
} else {
editor.addValueChangeListener(dataBinder);
}
gridField.removePropertyChangeListener(editor);
gridField.addPropertyChangeListener(editor);
editor.setValue(gridField.getValue());
//streach component to fill grid cell
if (editor.getComponent() instanceof Textbox)
((HtmlBasedComponent) editor.getComponent()).setWidth("98%");
else
editor.fillHorizontal();
}
return editor;
}
Aggregations