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;
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
ECodeLanguage language = repositoryContext.getProject().getLanguage();
IPreferenceStore preferenceStore = CorePlugin.getDefault().getPreferenceStore();
styledText = new UnnotifiableColorStyledText(tabFolderEditors, SWT.BORDER | SWT.V_SCROLL | SWT.H_SCROLL, preferenceStore, language.getName());
styledText.setEnabled(false);
item.setControl(styledText);
return styledText;
}
use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class ExpressionBuilderDialog method getExpressionStorePath.
/**
* yzhang Comment method "getExpressionStorePath".
*
* @return
*/
protected String getExpressionStorePath() {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
Project project = repositoryContext.getProject();
IProject p = root.getProject(project.getTechnicalLabel());
// put to the temp folder
String projectPath = p.getLocation().toPortableString() + File.separator + RepositoryConstants.TEMP_DIRECTORY;
String configurationPath = projectPath + File.separator + ExpressionPersistance.CONFIGURATION_FOLDER_NAME;
configurationPath = getValidFolderPath(configurationPath, 1);
File configurationFolder = new File(configurationPath);
if (!configurationFolder.exists()) {
configurationFolder.mkdir();
}
String expressionPath = configurationPath + File.separator + ExpressionPersistance.EXPRESSION_FOLDER_NAME;
expressionPath = getValidFolderPath(expressionPath, 1);
File expressionFolder = new File(expressionPath);
if (!expressionFolder.exists()) {
expressionFolder.mkdir();
}
String jobName = "";
if (component != null) {
jobName = component.getProcess().getName();
} else {
jobName = "tXMLMap";
}
expressionPath = expressionPath + File.separator + jobName + XmlUtil.FILE_XML_SUFFIX;
return expressionPath;
}
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;
}
use of org.talend.core.context.RepositoryContext in project tdi-studio-se by Talend.
the class ProjectSettingManager method saveProject.
public static void saveProject() {
RepositoryContext repositoryContext = (RepositoryContext) CorePlugin.getContext().getProperty(Context.REPOSITORY_CONTEXT_KEY);
IProxyRepositoryFactory prf = CorePlugin.getDefault().getProxyRepositoryFactory();
try {
prf.saveProject(repositoryContext.getProject());
} catch (Exception e) {
ExceptionHandler.process(e);
}
}
Aggregations