APISonar


org.jkiss.dbeaver.model.DBPEvaluationContext.UI

> org > jkiss > dbeaver > model > DBPEvaluationContext > UI
org APIs jkiss APIs dbeaver APIs model APIs DBPEvaluationContext APIs UI APIs

Example 1
protected Comparator getItemsComparator()
    {
        return new Comparator() {
            @Override
            public int compare(Object o1, Object o2)
            {
                if (o1 instanceof DBPNamedObject && o2 instanceof DBPNamedObject) {
                    return DBUtils.getObjectFullName((DBPNamedObject) o1, DBPEvaluationContext.UI).compareToIgnoreCase(
                        DBUtils.getObjectFullName((DBPNamedObject) o2, DBPEvaluationContext.UI));
                }
                return 0;
            }
        };
    }
Example 2
public String getElementName(Object item)
    {
        if (item instanceof DBPNamedObject) {
            return DBUtils.getObjectFullName((DBPNamedObject) item, DBPEvaluationContext.UI);
        }
        return item.toString();
    }
Example 3
protected String getObjectDisplayString(Object object)
    {
        DBPQualifiedObject adapted = RuntimeUtils.getObjectAdapter(object, DBPQualifiedObject.class);
        if (adapted != null) {
            return adapted.getFullyQualifiedName(DBPEvaluationContext.UI);
        } else {
            return null;
        }
    }
Example 4
public String getContainerFullName() {
        DBSObjectContainer container = getContainer();
        return container == null ? "" :
            container instanceof DBPDataSource ?
                DBUtils.getObjectFullName(container, DBPEvaluationContext.UI) :
                DBUtils.getObjectFullName(container, DBPEvaluationContext.UI) + " [" + container.getDataSource().getContainer().getName() + "]";
    }
Example 5
protected Control createPageContents(Composite parent) {
        Composite propsGroup = new Composite(parent, SWT.NONE);
        propsGroup.setLayout(new GridLayout(2, false));
        GridData gd = new GridData(GridData.FILL_HORIZONTAL);
        propsGroup.setLayoutData(gd);

        UIUtils.createLabelText(propsGroup, EditorsMessages.dialog_struct_create_sequence_container, DBUtils.getObjectFullName(sequence.getParentObject(), DBPEvaluationContext.UI)).setEditable(false);
        final Text nameText = UIUtils.createLabelText(propsGroup, EditorsMessages.dialog_struct_create_sequence_name, null);
        nameText.addModifyListener(e -> name = nameText.getText());
        return propsGroup;
    }
Example 6
public void exportHeader(DBCSession session) throws DBException, IOException
    {
        columns = getSite().getAttributes();
        DBPNamedObject source = getSite().getSource();
        if (source instanceof DBSObject) {
            tableName = omitSchema ?
                DBUtils.getQuotedIdentifier((DBSObject) source) :
                DBUtils.getObjectFullName(source, DBPEvaluationContext.UI);
        } else {
            throw new DBException("SQL export may be done only from table object");
        }
        rowCount = 0;
    }
Example 7
protected void addDatabaseBreakpointAttributes(Map<String, Object> attributes, DBSObject databaseObject, DBNNode node, DBGBreakpointDescriptor breakpointDescriptor) {
        attributes.put(DBGConstants.BREAKPOINT_ATTRIBUTE_DATASOURCE_ID, databaseObject.getDataSource().getContainer().getId());
        attributes.put(DBGConstants.BREAKPOINT_ATTRIBUTE_NODE_PATH, node.getNodeItemPath());
        attributes.put(DBGConstants.BREAKPOINT_ATTRIBUTE_OBJECT_NAME, DBUtils.getObjectFullName(databaseObject, DBPEvaluationContext.UI));
        attributes.putAll(breakpointDescriptor.toMap());
    }
Example 8
public static String getFilterContainerUniqueID(@Nullable DBSObject parentObject) {
        String objectFullName = DBUtils.getObjectFullName(parentObject, DBPEvaluationContext.UI);
        DBSInstance ownerInstance = DBUtils.getObjectOwnerInstance(parentObject);
        if (!CommonUtils.equalObjects(ownerInstance.getName(), parentObject.getDataSource().getName())) {
            return ownerInstance.getName() + ":" + objectFullName;
        } else {
            return objectFullName;
        }
    }
Example 9
protected ExasolTableKeyColumn[] fetchObjectRow(JDBCSession session, ExasolTable ExasolTable, ExasolTableForeignKey object,
                                                    JDBCResultSet dbResult) throws SQLException, DBException {

        String colName = JDBCUtils.safeGetString(dbResult, "COLUMN_NAME");
        ExasolTableColumn tableColumn = ExasolTable.getAttribute(session.getProgressMonitor(), colName);
        if (tableColumn == null) {
            log.info("ExasolTableForeignKeyCache : Column '" + colName + "' not found in table '" + ExasolTable.getFullyQualifiedName(DBPEvaluationContext.UI)
                + "' ??");
            return null;
        } else {
            return new ExasolTableKeyColumn[]{
                new ExasolTableKeyColumn(object, tableColumn, JDBCUtils.safeGetInt(dbResult, "ORDINAL_POSITION"))
            };
        }
    }
Example 10
private Composite createTableNameInput(Composite panel) {
        final Composite tableGroup = new Composite(panel, SWT.NONE);
        tableGroup.setLayout(new GridLayout(2, false));
        tableGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
        UIUtils.createLabelText(
            tableGroup,
            EditorsMessages.dialog_struct_columns_select_label_table,
            DBUtils.getObjectFullName(entity, DBPEvaluationContext.UI), SWT.BORDER | SWT.READ_ONLY, new GridData(GridData.FILL_HORIZONTAL));
        return tableGroup;
    }
Example 11
protected DB2TableCheckConstraintColumn[] fetchObjectRow(JDBCSession session, DB2Table db2Table,
                                                             DB2TableCheckConstraint object, JDBCResultSet dbResult) throws SQLException, DBException
    {

        String colName = JDBCUtils.safeGetString(dbResult, "COLNAME");
        DB2TableColumn tableColumn = db2Table.getAttribute(session.getProgressMonitor(), colName);
        DB2TableCheckConstraintColUsage usage = CommonUtils.valueOf(DB2TableCheckConstraintColUsage.class,
            JDBCUtils.safeGetString(dbResult, "USAGE"));
        if (tableColumn == null) {
            log.debug("Column '" + colName + "' not found in table '" + db2Table.getFullyQualifiedName(DBPEvaluationContext.UI) + "' ??");
            return null;
        } else {
            return new DB2TableCheckConstraintColumn[] { new DB2TableCheckConstraintColumn(object, tableColumn, usage) };
        }
    }
Example 12
public AttributeEditPage(@Nullable DBECommandContext commandContext, @NotNull DBSEntityAttribute attribute)
    {
        super(NLS.bind(EditorsMessages.dialog_struct_attribute_edit_page_header_edit_attribute, DBUtils.getObjectFullName(attribute, DBPEvaluationContext.UI)));
        this.commandContext = commandContext;
        this.attribute = attribute;
    }
Example 13
public void openNewContainer(DBRProgressMonitor monitor, DBSDataContainer dataContainer, DBDDataFilter newFilter) {
        final DBCExecutionContext executionContext = getExecutionContext();
        if (executionContext == null) {
            log.error("Can't open new container - not execution context found");
            return;
        }

        final DBNDatabaseNode targetNode = executionContext.getDataSource().getContainer().getPlatform().getNavigatorModel().getNodeByObject(monitor, dataContainer, false);
        if (targetNode == null) {
            UIUtils.showMessageBox(null, "Open link", "Can't navigate to '" + DBUtils.getObjectFullName(dataContainer, DBPEvaluationContext.UI) + "' - navigator node not found", SWT.ICON_ERROR);
            return;
        }

        openNewDataEditor(targetNode, newFilter);
    }
Example 14
TransformerSettingsDialog(ResultSetViewer viewer, DBDAttributeBinding currentAttribute, boolean selector) {
        super(viewer.getControl().getShell(), DBUtils.getObjectFullName(viewer.getDataContainer(), DBPEvaluationContext.UI) + " transforms", null);
        this.viewer = viewer;
        this.currentAttribute = currentAttribute;
        this.selector = selector;

        this.vEntitySrc = this.currentAttribute == null ?
            viewer.getModel().getVirtualEntity(true) :
            DBVUtils.getVirtualEntity(currentAttribute, true);
        this.vEntity = new DBVEntity(vEntitySrc.getContainer(), vEntitySrc, vEntitySrc.getModel());
    }