Search in sources :

Example 1 with DBPObjectWithDescription

use of org.jkiss.dbeaver.model.DBPObjectWithDescription in project dbeaver by serge-rider.

the class SessionManagerViewer method loadPlainTextDetails.

private void loadPlainTextDetails(DBAServerSessionDetails data, StyledText styledText) {
    SessionDetailsLoadService loadingService = new SessionDetailsLoadService(data);
    LoadingJob.createService(loadingService, new ProgressLoaderVisualizer<Collection<DBPObject>>(loadingService, styledText) {

        @Override
        public void completeLoading(Collection<DBPObject> dbpObjects) {
            StringBuilder text = new StringBuilder();
            for (DBPObject item : dbpObjects) {
                if (item instanceof DBPObjectWithDescription) {
                    text.append(((DBPObjectWithDescription) item).getDescription());
                    text.append(GeneralUtils.getDefaultLineSeparator());
                }
            }
            styledText.setText(text.toString());
        }
    }).schedule();
}
Also used : DBPObject(org.jkiss.dbeaver.model.DBPObject) ProgressLoaderVisualizer(org.jkiss.dbeaver.ui.controls.ProgressLoaderVisualizer) DBPObjectWithDescription(org.jkiss.dbeaver.model.DBPObjectWithDescription)

Aggregations

DBPObject (org.jkiss.dbeaver.model.DBPObject)1 DBPObjectWithDescription (org.jkiss.dbeaver.model.DBPObjectWithDescription)1 ProgressLoaderVisualizer (org.jkiss.dbeaver.ui.controls.ProgressLoaderVisualizer)1