Package com.dci.intellij.dbn.object.common.status

Examples of com.dci.intellij.dbn.object.common.status.DBObjectStatusHolder


        String bodyValidString = resultSet.getString("IS_BODY_VALID");

        String specDebugString = resultSet.getString("IS_SPEC_DEBUG");
        String bodyDebugString = resultSet.getString("IS_BODY_DEBUG");

        DBObjectStatusHolder objectStatus = getStatus();

        boolean specPresent = specValidString != null;
        boolean specValid = !specPresent || specValidString.equals("Y");
        boolean specDebug = !specPresent || specDebugString.equals("Y");

        boolean bodyPresent = bodyValidString != null;
        boolean bodyValid = !bodyPresent || bodyValidString.equals("Y");
        boolean bodyDebug = !bodyPresent || bodyDebugString.equals("Y");

        objectStatus.set(DBContentType.CODE_SPEC, DBObjectStatus.PRESENT, specPresent);
        objectStatus.set(DBContentType.CODE_SPEC, DBObjectStatus.VALID, specValid);
        objectStatus.set(DBContentType.CODE_SPEC, DBObjectStatus.DEBUG, specDebug);

        objectStatus.set(DBContentType.CODE_BODY, DBObjectStatus.PRESENT, bodyPresent);
        objectStatus.set(DBContentType.CODE_BODY, DBObjectStatus.VALID, bodyValid);
        objectStatus.set(DBContentType.CODE_BODY, DBObjectStatus.DEBUG, bodyDebug);

    }
View Full Code Here


            resultSet = getConnectionHandler().getInterfaceProvider().getMetadataInterface().loadInvalidObjects(getName(), connection);
            while (resultSet != null && resultSet.next()) {
                String objectName = resultSet.getString("OBJECT_NAME");
                DBSchemaObject schemaObject = (DBSchemaObject) getChildObjectNoLoad(objectName);
                if (schemaObject != null && schemaObject.getStatus().has(DBObjectStatus.VALID)) {
                    DBObjectStatusHolder objectStatus = schemaObject.getStatus();
                    boolean statusChanged;

                    if (schemaObject.getContentType().isBundle()) {
                        String objectType = resultSet.getString("OBJECT_TYPE");
                        statusChanged = objectType.contains("BODY") ?
                                objectStatus.set(DBContentType.CODE_BODY, DBObjectStatus.VALID, false) :
                                objectStatus.set(DBContentType.CODE_SPEC, DBObjectStatus.VALID, false);
                    }
                    else {
                        statusChanged = objectStatus.set(DBObjectStatus.VALID, false);
                    }
                    if (statusChanged) {
                        refreshNodes.add(schemaObject.getTreeParent());
                    }
                }
            }

            resultSet = getConnectionHandler().getInterfaceProvider().getMetadataInterface().loadDebugObjects(getName(), connection);
            while (resultSet != null && resultSet.next()) {
                String objectName = resultSet.getString("OBJECT_NAME");
                DBSchemaObject schemaObject = (DBSchemaObject) getChildObjectNoLoad(objectName);
                if (schemaObject != null && schemaObject.getStatus().has(DBObjectStatus.DEBUG)) {
                    DBObjectStatusHolder objectStatus = schemaObject.getStatus();
                    boolean statusChanged;

                    if (schemaObject.getContentType().isBundle()) {
                        String objectType = resultSet.getString("OBJECT_TYPE");
                        statusChanged = objectType.contains("BODY") ?
                                objectStatus.set(DBContentType.CODE_BODY, DBObjectStatus.DEBUG, true) :
                                objectStatus.set(DBContentType.CODE_SPEC, DBObjectStatus.DEBUG, true);
                    }
                    else {
                        statusChanged = objectStatus.set(DBObjectStatus.DEBUG, true);
                    }
                    if (statusChanged) {
                        refreshNodes.add(schemaObject.getTreeParent());
                    }
                }
View Full Code Here

            if (objectList.isLoaded() && !objectList.isDirty() && !objectList.isLoading()) {
                List<DBObject> objects = objectList.getObjects();
                for (DBObject object : objects) {
                    if (object instanceof DBSchemaObject) {
                        DBSchemaObject schemaObject = (DBSchemaObject) object;
                        DBObjectStatusHolder objectStatus = schemaObject.getStatus();
                        if (objectStatus.has(DBObjectStatus.VALID)) {
                            if (objectStatus.set(DBObjectStatus.VALID, true)) {
                                refreshNodes.add(object.getTreeParent());
                            }
                        }
                        if (objectStatus.has(DBObjectStatus.DEBUG)) {
                            if (objectStatus.set(DBObjectStatus.DEBUG, false)) {
                                refreshNodes.add(object.getTreeParent());
                            }
                        }
                    } else {
                        break;
View Full Code Here

    public void update(AnActionEvent e) {
        Presentation presentation = e.getPresentation();

        CompilerSettings compilerSettings = getCompilerSettings(object.getProject());
        CompileType compileType = compilerSettings.getCompileType();
        DBObjectStatusHolder status = object.getStatus();

        boolean isDebug = compileType == CompileType.DEBUG;
        if (compileType == CompileType.KEEP) {
            isDebug = status.is(contentType, DBObjectStatus.DEBUG);
        }

        boolean isPresent = status.is(contentType, DBObjectStatus.PRESENT);
        boolean isValid = status.is(contentType, DBObjectStatus.VALID);
        //boolean isDebug = status.is(contentType, DBObjectStatus.DEBUG);
        boolean isCompiling = status.is(contentType, DBObjectStatus.COMPILING);
        boolean isEnabled = isPresent && !isCompiling && (compilerSettings.alwaysShowCompilerControls() || !isValid/* || isDebug != isDebugActive*/);

        presentation.setEnabled(isEnabled);

        String text =
View Full Code Here

    public void initStatus(ResultSet resultSet) throws SQLException {
        boolean isEnabled = resultSet.getString("IS_ENABLED").equals("Y");
        boolean isValid = resultSet.getString("IS_VALID").equals("Y");
        boolean isDebug = resultSet.getString("IS_DEBUG").equals("Y");
        DBObjectStatusHolder objectStatus = getStatus();
        objectStatus.set(DBObjectStatus.ENABLED, isEnabled);
        objectStatus.set(DBObjectStatus.VALID, isValid);
        objectStatus.set(DBObjectStatus.DEBUG, isDebug);
    }
View Full Code Here

        return triggeringEvents;
    }

    @Override
    public Icon getIcon() {
        DBObjectStatusHolder status = getStatus();
        if (status.is(DBObjectStatus.VALID)) {
            if (status.is(DBObjectStatus.ENABLED)) {
                if (status.is(DBObjectStatus.DEBUG)) {
                    return Icons.DBO_TRIGGER_DEBUG;
                } else {
                    return Icons.DBO_TRIGGER;
                }
            } else {
                if (status.is(DBObjectStatus.DEBUG)) {
                    return Icons.DBO_TRIGGER_DISABLED_DEBUG;
                } else {
                    return Icons.DBO_TRIGGER_DISABLED;
                }
            }
        } else {
            if (status.is(DBObjectStatus.ENABLED)) {
                return Icons.DBO_TRIGGER_ERR;
            } else {
                return Icons.DBO_TRIGGER_ERR_DISABLED;
            }
View Full Code Here

        return DBObjectType.PROCEDURE;
    }

    public Icon getIcon() {
        if (getContentType() == DBContentType.CODE) {
            DBObjectStatusHolder objectStatus = getStatus();
            if (objectStatus.is(DBObjectStatus.VALID)) {
                if (objectStatus.is(DBObjectStatus.DEBUG)){
                    return Icons.DBO_PROCEDURE_DEBUG;
                }
            } else {
                return Icons.DBO_PROCEDURE_ERR;
            }
View Full Code Here

        }
    }

    public synchronized DBObjectStatusHolder getStatus() {
        if (objectStatus == null) {
            objectStatus = new DBObjectStatusHolder(getContentType());
        }
        return objectStatus;
    }
View Full Code Here

        return DBObjectType.FUNCTION;
    }

    public Icon getIcon() {
        if (getContentType() == DBContentType.CODE) {
            DBObjectStatusHolder objectStatus = getStatus();
            if (objectStatus.is(DBObjectStatus.VALID)) {
                if (objectStatus.is(DBObjectStatus.DEBUG)){
                    return Icons.DBO_FUNCTION_DEBUG;
                }
            } else {
                return Icons.DBO_FUNCTION_ERR;
            }
View Full Code Here

    @Override
    public void initStatus(ResultSet resultSet) throws SQLException {
        boolean isValid = "Y".equals(resultSet.getString("IS_VALID"));
        boolean isDebug = "Y".equals(resultSet.getString("IS_DEBUG"));
        DBObjectStatusHolder objectStatus = getStatus();
        objectStatus.set(DBObjectStatus.VALID, isValid);
        objectStatus.set(DBObjectStatus.DEBUG, isDebug);
    }
View Full Code Here

TOP

Related Classes of com.dci.intellij.dbn.object.common.status.DBObjectStatusHolder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.