use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class AddContextCommentValueMigrationTaskTest method beforeAllTests.
@BeforeClass
public static void beforeAllTests() throws PersistenceException, LoginException, CoreException {
createTempProject();
Context ctx = CoreRuntimePlugin.getInstance().getContext();
RepositoryContext repositoryContext = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
originalProject = repositoryContext.getProject();
repositoryContext.setProject(sampleProject);
}
use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class FixUnevenItemContextParametersMigrationTaskTest method beforeAllTests.
@BeforeClass
public static void beforeAllTests() throws PersistenceException, LoginException, CoreException {
createTempProject();
Context ctx = CoreRuntimePlugin.getInstance().getContext();
RepositoryContext repositoryContext = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
originalProject = repositoryContext.getProject();
repositoryContext.setProject(sampleProject);
}
use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class FixUnevenItemContextParametersMigrationTaskTest method afterAllTests.
@AfterClass
public static void afterAllTests() throws PersistenceException, CoreException {
removeTempProject();
Context ctx = CoreRuntimePlugin.getInstance().getContext();
RepositoryContext repositoryContext = (RepositoryContext) ctx.getProperty(Context.REPOSITORY_CONTEXT_KEY);
repositoryContext.setProject(originalProject);
originalProject = null;
sampleProject = null;
}
use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class OpenExistVersionProcessWizard method openAnotherVersion.
protected void openAnotherVersion(final RepositoryNode node, final boolean readonly) {
try {
if (node.getObject() != null) {
final Item item = node.getObject().getProperty().getItem();
final IWorkbenchPage page = getActivePage();
final RepositoryEditorInput fileEditorInput = getEditorInput(item, readonly, page);
if (fileEditorInput != null) {
IEditorPart editorPart = page.findEditor(fileEditorInput);
if (editorPart == null) {
fileEditorInput.setRepositoryNode(node);
if (item instanceof ProcessItem) {
page.openEditor(fileEditorInput, MultiPageTalendEditor.ID, readonly);
} else if (item instanceof BusinessProcessItem) {
CorePlugin.getDefault().getDiagramModelService().openBusinessDiagramEditor(page, fileEditorInput);
} else {
ECodeLanguage lang = ((RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY)).getProject().getLanguage();
//$NON-NLS-1$ //$NON-NLS-2$
String talendEditorID = "org.talend.designer.core.ui.editor.StandAloneTalend" + lang.getCaseName() + "Editor";
page.openEditor(fileEditorInput, talendEditorID);
}
} else {
page.activate(editorPart);
}
} else {
// TDI-19014:open another version of jobScript
if (item instanceof JobScriptItem) {
IProject fsProject = ResourceUtils.getProject(ProjectManager.getInstance().getCurrentProject());
openXtextEditor(node, fsProject, readonly);
}
}
}
} catch (PartInitException e) {
MessageBoxExceptionHandler.process(e);
} catch (SystemException e) {
MessageBoxExceptionHandler.process(e);
}
}
use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class TabFolderEditors method createStyledText.
private StyledText createStyledText(CTabItem item) {
StyledText styledText = null;
if (MapperMain.isStandAloneMode()) {
styledText = new StyledText(tabFolderEditors, SWT.V_SCROLL | SWT.H_SCROLL);
} else {
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
ECodeLanguage language = repositoryContext.getProject().getLanguage();
IPreferenceStore preferenceStore = CorePlugin.getDefault().getPreferenceStore();
// styledText = new ColorStyledText(tabFolderEditors, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL,
// colorManager, language.getName());
styledText = new UnnotifiableColorStyledText(tabFolderEditors, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, preferenceStore, language.getName());
}
styledText.setEnabled(false);
item.setControl(styledText);
return styledText;
}
Aggregations