use of com.liferay.ide.ui.form.TablePart in project liferay-ide by liferay.
the class PortalJarsSection method _updateButtons.
private void _updateButtons() {
TableViewer viewer = getTablePart().getTableViewer();
Table table = viewer.getTable();
TableItem[] selection = table.getSelection();
boolean hasSelection = false;
if (ListUtil.isNotEmpty(selection)) {
hasSelection = true;
}
TablePart tablePart = getTablePart();
tablePart.setButtonEnabled(_ADD_INDEX, isEditable());
_updateUpDownButtons();
tablePart.setButtonEnabled(_REMOVE_INDEX, isEditable() && hasSelection);
}
use of com.liferay.ide.ui.form.TablePart in project liferay-ide by liferay.
the class PortalJarsSection method _updateUpDownButtons.
private void _updateUpDownButtons() {
TablePart tablePart = getTablePart();
TableViewer viewer = getTablePart().getTableViewer();
Table table = viewer.getTable();
TableItem[] selection = table.getSelection();
boolean hasSelection = false;
if (ListUtil.isNotEmpty(selection)) {
hasSelection = true;
}
boolean canMove = false;
if ((table.getItemCount() > 1) && (selection.length == 1)) {
canMove = true;
}
tablePart.setButtonEnabled(_UP_INDEX, canMove && isEditable() && hasSelection && table.getSelectionIndex() > 0);
tablePart.setButtonEnabled(_DOWN_INDEX, canMove && hasSelection && isEditable() && table.getSelectionIndex() < table.getItemCount() - 1);
}
use of com.liferay.ide.ui.form.TablePart in project liferay-ide by liferay.
the class RequiredDeploymentContextsSection method _updateButtons.
private void _updateButtons() {
TableViewer viewer = getTablePart().getTableViewer();
TableItem[] selection = viewer.getTable().getSelection();
boolean hasSelection = false;
if (ListUtil.isNotEmpty(selection)) {
hasSelection = true;
}
TablePart tablePart = getTablePart();
tablePart.setButtonEnabled(_ADD_INDEX, isEditable());
_updateUpDownButtons();
tablePart.setButtonEnabled(_REMOVE_INDEX, isEditable() && hasSelection);
}
Aggregations