use of com.liferay.ide.ui.form.TablePart in project liferay-ide by liferay.
the class PortalTldsSection method _updateUpDownButtons.
private void _updateUpDownButtons() {
TablePart tablePart = getTablePart();
// if (fSortAction.isChecked()) {
// tablePart.setButtonEnabled(UP_INDEX, false);
// tablePart.setButtonEnabled(DOWN_INDEX, false);
// return;
// }
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 PortalTldsSection method createClient.
public void createClient(Section section, FormToolkit toolkit) {
Composite container = createClientContainer(section, 2, toolkit);
createViewerPartControl(container, SWT.MULTI, 2, toolkit);
TablePart tablePart = getTablePart();
_fViewer = tablePart.getTableViewer();
_fViewer.setContentProvider(new PortalTldsContentProvider());
_fViewer.setLabelProvider(new PortalTldsLabelProvider());
toolkit.paintBordersFor(container);
_makeActions();
section.setClient(container);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.minimumWidth = 250;
gd.grabExcessVerticalSpace = true;
section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
section.setLayoutData(gd);
section.setText(Msgs.portalDependencyTlds);
_createSectionToolbar(section);
initialize();
}
use of com.liferay.ide.ui.form.TablePart in project liferay-ide by liferay.
the class RequiredDeploymentContextsSection method _updateUpDownButtons.
private void _updateUpDownButtons() {
TablePart tablePart = getTablePart();
// if (fSortAction.isChecked()) {
// tablePart.setButtonEnabled(UP_INDEX, false);
// tablePart.setButtonEnabled(DOWN_INDEX, false);
// return;
// }
Table table = tablePart.getTableViewer().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 createClient.
public void createClient(Section section, FormToolkit toolkit) {
Composite container = createClientContainer(section, 2, toolkit);
createViewerPartControl(container, SWT.MULTI, 2, toolkit);
TablePart tablePart = getTablePart();
_fViewer = tablePart.getTableViewer();
_fViewer.setContentProvider(new ContextsContentProvider());
_fViewer.setLabelProvider(new ContextsLabelProvider());
toolkit.paintBordersFor(container);
_makeActions();
section.setClient(container);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.minimumWidth = 250;
gd.grabExcessVerticalSpace = true;
section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
section.setLayoutData(gd);
section.setText(Msgs.serviceDependencies);
_createSectionToolbar(section);
initialize();
}
use of com.liferay.ide.ui.form.TablePart in project liferay-ide by liferay.
the class PortalJarsSection method createClient.
public void createClient(Section section, FormToolkit toolkit) {
Composite container = createClientContainer(section, 2, toolkit);
createViewerPartControl(container, SWT.MULTI, 2, toolkit);
TablePart tablePart = getTablePart();
_fViewer = tablePart.getTableViewer();
_fViewer.setContentProvider(new PortalJarsContentProvider());
_fViewer.setLabelProvider(new PortalJarsLabelProvider());
toolkit.paintBordersFor(container);
_makeActions();
section.setClient(container);
GridData gd = new GridData(GridData.FILL_BOTH);
gd.minimumWidth = 250;
gd.grabExcessVerticalSpace = true;
section.setLayout(FormLayoutFactory.createClearGridLayout(false, 1));
section.setLayoutData(gd);
section.setText(Msgs.portalDependencyJars);
_createSectionToolbar(section);
initialize();
}
Aggregations