Beispiel #1
0
void RefactoringPlugin::init(PluginConfigurator const &configurator)
{
	mErrorReporter = configurator.mainWindowInterpretersInterface().errorReporter();
	mLogicalModelApi = &configurator.logicalModelApi();
	mGraphicalModelApi = &configurator.graphicalModelApi();

	mMetamodelGeneratorSupport = new MetamodelGeneratorSupport(
			configurator.mainWindowInterpretersInterface().errorReporter()
			, &configurator.mainWindowInterpretersInterface());
	mRepoControlIFace = &configurator.repoControlInterface();
	mMainWindowIFace = &configurator.mainWindowInterpretersInterface();
	mQRealSourceFilesPath = SettingsManager::value("qrealSourcesLocation", "").toString();
	mQRealSourceFilesPath = SettingsManager::value("qrealSourcesLocation").toString();
	mPathToRefactoringExamples = mQRealSourceFilesPath + "/plugins/refactoring/refactoringExamples/";

	mRefactoringWindow = new RefactoringWindow(mMainWindowIFace->windowWidget());
	connect(mRefactoringWindow, SIGNAL(rejected()), this, SLOT(discardRefactoring()));

	mRefactoringRepoApi = new qrRepo::RepoApi(mQRealSourceFilesPath + "/plugins/refactoring/refactoringExamples", true);
	mRefactoringFinder = new RefactoringFinder(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, mRefactoringRepoApi);

	connect(mRefactoringWindow, SIGNAL(findButtonClicked(QString)), this, SLOT(findRefactoring(QString)));
	connect(mRefactoringWindow, SIGNAL(findNextButtonClicked()), this, SLOT(findNextRefactoring()));
	connect(mRefactoringWindow, SIGNAL(discardButtonClicked()), this, SLOT(discardRefactoring()));
	connect(mRefactoringWindow, SIGNAL(applyButtonClicked()), this, SLOT(applyRefactoring()));

	mRefactoringApplier = new RefactoringApplier(configurator.logicalModelApi()
			, configurator.graphicalModelApi()
			, configurator.mainWindowInterpretersInterface()
			, mRefactoringRepoApi
			, &mCurrentMatch);
}
void MetaEditorSupportPlugin::init(PluginConfigurator const &configurator)
{
    mMainWindowInterface = &configurator.mainWindowInterpretersInterface();
    mLogicalRepoApi = &configurator.logicalModelApi().mutableLogicalRepoApi();
    mRepoControlApi = &configurator.repoControlInterface();
}