PlainTextEditorEditable::PlainTextEditorEditable(PlainTextEditor *editor)
  : BaseTextEditorEditable(editor)
{
    Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
    m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_TEXT_EDITOR_ID);
    m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
CMakeEditorEditable::CMakeEditorEditable(CMakeEditor *editor)
    : BaseTextEditorEditable(editor)
{
    Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
    m_context << uidm->uniqueIdentifier(CMakeProjectManager::Constants::C_CMAKEEDITOR);
    m_context << uidm->uniqueIdentifier(TextEditor::Constants::C_TEXTEDITOR);
}
示例#3
0
HTMLEditor::HTMLEditor(HTMLEditorWidget* editorWidget)
    :Core::IEditor(editorWidget)
{
    d = new HTMLEditorData;
    d->editorWidget = editorWidget;
    d->file = new HTMLFile(this, editorWidget);

    Core::UniqueIDManager* uidm = Core::UniqueIDManager::instance();
    d->context << uidm->uniqueIdentifier(HTMLEditorConstants::C_HTMLEDITOR);

    connect(d->editorWidget, SIGNAL(contentModified()),
            d->file, SLOT(modified()));
    connect(d->editorWidget, SIGNAL(titleChanged(QString)),
            this, SLOT(slotTitleChanged(QString)));
    connect(d->editorWidget, SIGNAL(contentModified()),
            this, SIGNAL(changed()));
}
void DocumentEditorPlugin::initializeEditor(DocumentEdit *editor)
{
    DocumentEditorInterface *editorInterface = new DocumentEditorInterface(editor);
    //QObject::connect(editor, SIGNAL(modificationChanged(bool)), editorInterface, SIGNAL(changed()));
    editor->setEditorInterface(editorInterface);

    Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
    m_context << uidm->uniqueIdentifier(Constants::C_DOCUMENTEDITOR);
//    if (!m_undoAction) {
//        m_undoAction      = registerNewAction(QLatin1String(Core::Constants::UNDO),
//                                              this, SLOT(undoAction()),
//                                              tr("&Undo"));
//        m_redoAction      = registerNewAction(QLatin1String(Core::Constants::REDO),
//                                              this, SLOT(redoAction()),
//                                              tr("&Redo"));
//        m_copyAction      = registerNewAction(QLatin1String(Core::Constants::COPY),
//                                              this, SLOT(copyAction()));
//        m_selectAllAction = registerNewAction(QLatin1String(Core::Constants::SELECTALL),
//                                              this, SLOT(selectAllAction()));
//    }

    // Font settings
    //TextEditor::TextEditorSettings *settings = TextEditor::TextEditorSettings::instance();
    //editor->setFontSettings(settings->fontSettings());
    //connect(settings, SIGNAL(fontSettingsChanged(TextEditor::FontSettings)),
    //        editor, SLOT(setFontSettings(TextEditor::FontSettings)));

    //QObject::connect(editor, SIGNAL(undoAvailable(bool)), this, SLOT(updateActions()));
    //QObject::connect(editor, SIGNAL(redoAvailable(bool)), this, SLOT(updateActions()));
    //QObject::connect(editor, SIGNAL(copyAvailable(bool)), this, SLOT(updateActions()));

    Aggregation::Aggregate *aggregate = new Aggregation::Aggregate;
    //DocumentEditorFind *DocumentEditorFind = new DocumentEditorFind(editor);
    //aggregate->add(binEditorFind);
    aggregate->add(editor);
}
 DocumentEditorInterface::DocumentEditorInterface(DocumentEdit *parent)
        : Core::IEditor(parent)
    {
        Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
        m_editor = parent;
        m_file = new DocumentEditorFile(parent);
//        m_context << uidm->uniqueIdentifier(Core::Constants::K_DEFAULT_BINARY_EDITOR);
        m_context << uidm->uniqueIdentifier(Constants::C_DOCUMENTEDITOR);
//        m_cursorPositionLabel = new Core::Utils::LineColumnLabel;
//
//        QHBoxLayout *l = new QHBoxLayout;
//        QWidget *w = new QWidget;
//        l->setMargin(0);
//        l->setContentsMargins(0, 0, 5, 0);
//        l->addStretch(1);
//        l->addWidget(m_cursorPositionLabel);
//        w->setLayout(l);
//
//        m_toolBar = new QToolBar;
//        m_toolBar->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
//        m_toolBar->addWidget(w);
//
//        connect(m_editor, SIGNAL(cursorPositionChanged(int)), this, SLOT(updateCursorPosition(int)));
    }
Manager::Manager()
{
    Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
    m_projectContext  = uidm->uniqueIdentifier(QmlProjectManager::Constants::PROJECTCONTEXT);
    m_projectLanguage = uidm->uniqueIdentifier(QmlProjectManager::Constants::LANG_QML);
}
示例#7
0
Manager::Manager()
{
    Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
    m_projectContext  = uidm->uniqueIdentifier(GenericProjectManager::Constants::PROJECTCONTEXT);
    m_projectLanguage = uidm->uniqueIdentifier(ProjectExplorer::Constants::LANG_CXX);
}
ProjectFilesEditable::ProjectFilesEditable(ProjectFilesEditor *editor)
    : TextEditor::BaseTextEditorEditable(editor)
{
    Core::UniqueIDManager *uidm = Core::UniqueIDManager::instance();
    m_context << uidm->uniqueIdentifier(Constants::C_FILESEDITOR);
}
示例#9
0
bool
ServantPlugin::initialize(const QStringList &arguments, QString *error_message)
{
    Q_UNUSED(arguments);
    int nErrors = 0;

    do { adportable::debug(__FILE__, __LINE__) << "<----- ServantPlugin::initialize() ..."; } while(0);

    OutputWindow * outputWindow = new OutputWindow;
    addAutoReleasedObject( outputWindow );
    pImpl_ = new internal::ServantPluginImpl( outputWindow );

    ///////////////////////////////////
    Core::ICore * core = Core::ICore::instance();
    QList<int> context;
    if ( core ) {
        Core::UniqueIDManager * uidm = core->uniqueIDManager();
        if ( uidm ) {
            context.append( uidm->uniqueIdentifier( QLatin1String("Servant.MainView") ) );
            context.append( uidm->uniqueIdentifier( Core::Constants::C_NAVIGATION_PANE ) );
        }
    } else
        return false;
    
    // ACE initialize
    // acewrapper::instance_manager::initialize();
    // <------
    
	boost::filesystem::path plugindir;
    do {
        std::wstring apppath = qtwrapper::application::path( L".." ); // := "~/qtplatz/bin/.."
		std::wstring configFile = adplugin::loader::config_fullpath( apppath, L"/MS-Cheminformatics/does-not-exist.adplugin" );
		plugindir = boost::filesystem::path( configFile ).branch_path();
    } while(0);

	// populate .adplugin files under given folder.
	adplugin::loader::populate( plugindir.generic_wstring().c_str() );

	std::vector< adplugin::plugin_ptr > spectrometers;
	if ( adplugin::loader::select_iids( ".*\\.adplugins\\.massSpectrometer\\..*", spectrometers ) ) {
		std::for_each( spectrometers.begin(), spectrometers.end(), []( const adplugin::plugin_ptr& d ){ 
			adcontrols::massspectrometer_factory * factory = d->query_interface< adcontrols::massspectrometer_factory >();
			if ( factory )
				adcontrols::massSpectrometerBroker::register_factory( factory, factory->name() );
		});
	}
    // ------------ Broker::Manager initialize first --------------------
    adorbmgr::orbmgr * pMgr = adorbmgr::orbmgr::instance();
	if ( pMgr ) {
		pMgr->init( 0, 0 );
		pMgr->spawn();
	}
    //--------------------------------------------------------------------
    //--------------------------------------------------------------------
    Broker::Manager_var bmgr;
	adplugin::plugin_ptr adbroker = adplugin::loader::select_iid( ".*\\.orbfactory\\.adbroker" );
	if ( adbroker ) {
		internal::orbServantCreator broker_creator;
		adplugin::orbServant * adBroker = broker_creator( adbroker, orbServants_ );
        if ( adBroker ) {
            bmgr = Broker::Manager::_narrow( broker_creator.obj );
            if ( CORBA::is_nil( bmgr ) ) {
                *error_message = "Broker::Manager cannot be created";
                return false;
            }
        } else {
            *error_message = broker_creator.errmsg.str().empty() ? 
                "adplugin for Broker::Manager did not loaded." : broker_creator.errmsg.str().c_str();
            return false;
        }
		adorbmgr::orbmgr::instance()->setBrokerManager( bmgr );
        size_t nTrial = 3;
        while ( nTrial-- ) {
            try {
                bmgr->register_ior( adBroker->object_name(), broker_creator.ior.c_str() );
            } catch ( CORBA::Exception& ex ) {
                if ( /* ex.get_id() == CORBA::TRANSIENT && */ nTrial )
                    std::this_thread::sleep_for( std::chrono::milliseconds(10) );
                else {
                    *error_message = QString( "CORBA::Exception : " ) + ex._info().c_str();
                    return false;
                }
            }
        }
    }
    pImpl_->init_debug_adbroker( bmgr );

    // ----------------------- initialize corba servants ------------------------------
    std::vector< adplugin::plugin_ptr > factories;
    adplugin::loader::select_iids( ".*\\.adplugins\\.orbfactory\\..*", factories );
    for ( const adplugin::plugin_ptr& ptr: factories ) {

        if ( ptr->iid() == adbroker->iid() )
            continue;

        internal::orbServantCreator creator;
        adplugin::orbServant * servant = creator( ptr, orbServants_ );
        if ( servant ) {
            BrokerClient::Accessor_var accessor = BrokerClient::Accessor::_narrow( creator.obj );
            if ( !CORBA::is_nil( accessor ) ) {
                accessor->setBrokerManager( bmgr.in() );
				accessor->adpluginspec( ptr->clsid(), ptr->adpluginspec() );
            }
            try {
                bmgr->register_ior( servant->object_name(), creator.ior.c_str() );
                bmgr->register_object( servant->object_name(), creator.obj );
            } catch ( CORBA::Exception& ex ) {
                *error_message = ex._info().c_str();
                return false;
            }
        }
    }

    using namespace acewrapper::constants;
    ControlServer::Manager_var cmgr ( internal::findObject< ControlServer::Manager >::find( bmgr.in(), adcontroller::manager::_name() ) );
	if ( ! CORBA::is_nil( cmgr ) ) {
        ControlServer::Session_var session = cmgr->getSession( L"debug" );
        if ( ! CORBA::is_nil( session ) )
			pImpl_->init_debug_adcontroller( session );
	}

    // 
    ControlServer::Session_var session;
    std::vector< Instrument::Session_var > i8t_sessions;

    do { adportable::debug(__FILE__, __LINE__) << "<-- ServantPlugin::initialize() ### 3 ##"; } while(0);

    if ( ! CORBA::is_nil( session ) )
        session->configComplete();

    Logger log;
    log( ( nErrors ? L"Servant iitialized with errors" : L"Servernt initialized successfully") );
    
    do { adportable::debug() << "----> ServantPlugin::initialize() completed."; } while(0);
    return true;
}