Search in sources :

Example 6 with EJDataRecord

use of org.entirej.framework.core.data.EJDataRecord in project rap by entirej.

the class EJRWTListRecordBlockRenderer method recordDeleted.

public void recordDeleted(int dataBlockRecordNumber) {
    EJDataRecord recordAt = getRecordAt(dataBlockRecordNumber > 1 ? dataBlockRecordNumber - 2 : 0);
    if (recordAt == null) {
        recordAt = getLastRecord();
    }
    if (_tableViewer != null && !_tableViewer.getTable().isDisposed()) {
        clearFilter();
        _tableViewer.setInput(new Object());
        applyFileter();
    }
    if (recordAt != null)
        recordSelected(recordAt);
}
Also used : EJDataRecord(org.entirej.framework.core.data.EJDataRecord)

Example 7 with EJDataRecord

use of org.entirej.framework.core.data.EJDataRecord in project rap by entirej.

the class EJRWTListRecordBlockRenderer method notifyStatus.

protected void notifyStatus() {
    if (hasFocus()) {
        EJRWTApplicationManager mng = (EJRWTApplicationManager) _block.getFrameworkManager().getApplicationManager();
        int displayedRecordCount = getDisplayedRecordCount();
        if (mng.getStatusbar() != null) {
            EJDataRecord focusedRecord = getFocusedRecord();
            int displayedRecordNumber = getDisplayedRecordNumber(focusedRecord);
            if (displayedRecordCount > 0 && displayedRecordNumber == -1) {
                mng.getStatusbar().setStatus2("");
            } else {
                mng.getStatusbar().setStatus2(String.format("%s of %s", String.valueOf(displayedRecordNumber + 1), String.valueOf(displayedRecordCount)));
            }
        }
    } else {
        EJRWTApplicationManager mng = (EJRWTApplicationManager) _block.getFrameworkManager().getApplicationManager();
        if (mng.getStatusbar() != null) {
            mng.getStatusbar().setStatus2("");
        }
    }
}
Also used : EJRWTApplicationManager(org.entirej.applicationframework.rwt.application.EJRWTApplicationManager) EJDataRecord(org.entirej.framework.core.data.EJDataRecord)

Example 8 with EJDataRecord

use of org.entirej.framework.core.data.EJDataRecord in project rap by entirej.

the class EJRWTListRecordBlockRenderer method getFocusedRecord.

public EJDataRecord getFocusedRecord() {
    EJDataRecord _focusedRecord = null;
    if (_tableViewer != null && !_tableViewer.getTable().isDisposed()) {
        ISelection selection = _tableViewer.getSelection();
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection = (IStructuredSelection) selection;
            Object firstElement = structuredSelection.getFirstElement();
            if (firstElement instanceof EJDataRecord) {
                _focusedRecord = (EJDataRecord) firstElement;
            }
        }
    }
    return _focusedRecord;
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EJDataRecord(org.entirej.framework.core.data.EJDataRecord)

Example 9 with EJDataRecord

use of org.entirej.framework.core.data.EJDataRecord in project rap by entirej.

the class EJRWTSingleRecordBlockRenderer method notifyStatus.

protected void notifyStatus() {
    if (hasFocus()) {
        EJRWTApplicationManager mng = (EJRWTApplicationManager) _block.getFrameworkManager().getApplicationManager();
        int displayedRecordCount = getDisplayedRecordCount();
        if (mng.getStatusbar() != null) {
            EJDataRecord focusedRecord = getFocusedRecord();
            int displayedRecordNumber = getDisplayedRecordNumber(focusedRecord);
            if (displayedRecordCount > 0 && displayedRecordNumber == -1) {
                mng.getStatusbar().setStatus2("");
            } else {
                mng.getStatusbar().setStatus2(String.format("%s of %s", String.valueOf(displayedRecordNumber + 1), String.valueOf(displayedRecordCount)));
            }
        }
    } else {
        EJRWTApplicationManager mng = (EJRWTApplicationManager) _block.getFrameworkManager().getApplicationManager();
        if (mng.getStatusbar() != null) {
            mng.getStatusbar().setStatus2("");
        }
    }
}
Also used : EJRWTApplicationManager(org.entirej.applicationframework.rwt.application.EJRWTApplicationManager) EJDataRecord(org.entirej.framework.core.data.EJDataRecord)

Example 10 with EJDataRecord

use of org.entirej.framework.core.data.EJDataRecord in project rap by entirej.

the class EJRWTTreeTableRecordBlockRenderer method getFocusedRecord.

@Override
public EJDataRecord getFocusedRecord() {
    EJDataRecord _focusedRecord = null;
    if (_tableViewer != null && !_tableViewer.getTree().isDisposed()) {
        ISelection selection = _tableViewer.getSelection();
        if (selection instanceof IStructuredSelection) {
            IStructuredSelection structuredSelection = (IStructuredSelection) selection;
            Object firstElement = structuredSelection.getFirstElement();
            if (firstElement instanceof EJDataRecord) {
                _focusedRecord = (EJDataRecord) firstElement;
            }
        }
    }
    return _focusedRecord;
}
Also used : ISelection(org.eclipse.jface.viewers.ISelection) IStructuredSelection(org.eclipse.jface.viewers.IStructuredSelection) EJDataRecord(org.entirej.framework.core.data.EJDataRecord)

Aggregations

EJDataRecord (org.entirej.framework.core.data.EJDataRecord)52 ColumnLabelProvider (org.eclipse.jface.viewers.ColumnLabelProvider)18 EJScreenItemProperties (org.entirej.framework.core.properties.interfaces.EJScreenItemProperties)16 EJCoreVisualAttributeProperties (org.entirej.framework.core.properties.EJCoreVisualAttributeProperties)15 Color (org.eclipse.swt.graphics.Color)12 EJFrameworkExtensionProperties (org.entirej.framework.core.properties.definitions.interfaces.EJFrameworkExtensionProperties)12 Viewer (org.eclipse.jface.viewers.Viewer)11 EJScreenItemController (org.entirej.framework.core.interfaces.EJScreenItemController)11 ArrayList (java.util.ArrayList)10 EJCoreMainScreenItemProperties (org.entirej.framework.core.properties.EJCoreMainScreenItemProperties)10 EJMessage (org.entirej.framework.core.EJMessage)9 EJRWTAbstractTableSorter (org.entirej.applicationframework.rwt.table.EJRWTAbstractTableSorter)8 EJBlockProperties (org.entirej.framework.core.properties.interfaces.EJBlockProperties)8 JsonObject (org.eclipse.rap.json.JsonObject)7 GridData (org.eclipse.swt.layout.GridData)7 EJFrameworkExtensionPropertyListEntry (org.entirej.framework.core.properties.definitions.interfaces.EJFrameworkExtensionPropertyListEntry)7 EJItemGroupProperties (org.entirej.framework.core.properties.interfaces.EJItemGroupProperties)7 HashMap (java.util.HashMap)6 ISelection (org.eclipse.jface.viewers.ISelection)6 IStructuredSelection (org.eclipse.jface.viewers.IStructuredSelection)6