Search in sources :

Example 6 with TablePart

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);
}
Also used : Table(org.eclipse.swt.widgets.Table) TableItem(org.eclipse.swt.widgets.TableItem) TablePart(com.liferay.ide.ui.form.TablePart) TableViewer(org.eclipse.jface.viewers.TableViewer)

Example 7 with TablePart

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();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) TablePart(com.liferay.ide.ui.form.TablePart) GridData(org.eclipse.swt.layout.GridData)

Example 8 with TablePart

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);
}
Also used : Table(org.eclipse.swt.widgets.Table) TableItem(org.eclipse.swt.widgets.TableItem) TablePart(com.liferay.ide.ui.form.TablePart)

Example 9 with TablePart

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();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) TablePart(com.liferay.ide.ui.form.TablePart) GridData(org.eclipse.swt.layout.GridData)

Example 10 with TablePart

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();
}
Also used : Composite(org.eclipse.swt.widgets.Composite) TablePart(com.liferay.ide.ui.form.TablePart) GridData(org.eclipse.swt.layout.GridData)

Aggregations

TablePart (com.liferay.ide.ui.form.TablePart)13 TableItem (org.eclipse.swt.widgets.TableItem)8 Table (org.eclipse.swt.widgets.Table)7 TableViewer (org.eclipse.jface.viewers.TableViewer)6 GridData (org.eclipse.swt.layout.GridData)4 Composite (org.eclipse.swt.widgets.Composite)4 IPluginPackageModel (com.liferay.ide.portlet.core.IPluginPackageModel)1 PluginPackageModel (com.liferay.ide.portlet.core.PluginPackageModel)1 SDK (com.liferay.ide.sdk.core.SDK)1 File (java.io.File)1 IFolder (org.eclipse.core.resources.IFolder)1 IProject (org.eclipse.core.resources.IProject)1 IPath (org.eclipse.core.runtime.IPath)1