use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class AutoUpdateRelationsMigrationTask method unloadObject.
@Override
public void unloadObject(IRepositoryViewObject object) {
if (object instanceof RepositoryObject) {
RepositoryObject obj = (RepositoryObject) object;
obj.unload();
}
}
use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class BuildRecycleBinIndexMigrationTask method unloadObject.
@Override
public void unloadObject(IRepositoryViewObject object) {
if (object instanceof RepositoryObject) {
RepositoryObject obj = (RepositoryObject) object;
obj.unload();
}
}
use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class StatusConfirmSettingDialog method createDialogArea.
@Override
protected Control createDialogArea(Composite parent) {
Composite composite = (Composite) super.createDialogArea(parent);
TableViewer viewer = new TableViewer(composite, SWT.H_SCROLL | SWT.V_SCROLL | SWT.BORDER);
GridData data = new GridData(GridData.FILL_BOTH);
data.minimumHeight = 200;
data.heightHint = 200;
data.minimumWidth = 350;
data.widthHint = 350;
viewer.getControl().setLayoutData(data);
final Table table = viewer.getTable();
table.setHeaderVisible(true);
table.setLinesVisible(true);
TableColumn column = new TableColumn(table, SWT.NONE);
//$NON-NLS-1$
column.setText(Messages.getString("VersionManagementDialog.Items"));
column.setWidth(140);
column = new TableColumn(table, SWT.NONE);
//$NON-NLS-1$
column.setText(Messages.getString("StatusManagementDialog.Status"));
column.setWidth(120);
column = new TableColumn(table, SWT.NONE);
//$NON-NLS-1$
column.setText(Messages.getString("StatusManagementDialog.NewStatus"));
column.setWidth(90);
viewer.setContentProvider(ArrayContentProvider.getInstance());
viewer.setLabelProvider(new ITableLabelProvider() {
public Image getColumnImage(Object element, int columnIndex) {
RepositoryObject object = (RepositoryObject) element;
if (columnIndex == 0) {
ERepositoryObjectType itemType = object.getRepositoryObjectType();
return getItemsImage(CoreImageProvider.getIcon(itemType));
}
return null;
}
public String getColumnText(Object element, int columnIndex) {
RepositoryObject object = (RepositoryObject) element;
switch(columnIndex) {
case 0:
return object.getLabel();
case 1:
return statusHelper.getStatusLabel(object.getProperty().getOldStatusCode());
case 2:
if (object.getStatusCode().equals(object.getProperty().getOldStatusCode())) {
//$NON-NLS-1$
return "-";
}
return statusHelper.getStatusLabel(object.getStatusCode());
default:
}
return null;
}
public void addListener(ILabelProviderListener listener) {
}
public void dispose() {
}
public boolean isLabelProperty(Object element, String property) {
return false;
}
public void removeListener(ILabelProviderListener listener) {
}
});
viewer.setInput(modifiedVersionItems);
for (TableItem item : table.getItems()) {
RepositoryObject object = (RepositoryObject) item.getData();
// if (!object.getOldVersion().equals(object.getNewVersion())) {
item.setForeground(2, Display.getDefault().getSystemColor(SWT.COLOR_RED));
// }
}
return composite;
}
use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class OpenDiagramAction method doRun.
/*
* (non-Javadoc)
*
* @see org.eclipse.jface.action.Action#run()
*/
@Override
protected void doRun() {
ISelection selection = getSelectedObject();
if (selection == null) {
return;
}
Object obj = ((IStructuredSelection) selection).getFirstElement();
if (obj instanceof RepositoryNode) {
RepositoryNode repositoryNode = (RepositoryNode) obj;
IRepositoryViewObject repositoryObject = repositoryNode.getObject();
Property updatedProperty = null;
if (repositoryObject instanceof RepositoryObject) {
RepositoryViewObject abstractRepositoryObject = new RepositoryViewObject(repositoryObject.getProperty());
updatedProperty = abstractRepositoryObject.getProperty();
} else if (repositoryObject instanceof RepositoryViewObject) {
updatedProperty = repositoryObject.getProperty();
}
if (updatedProperty != null) {
BusinessProcessItem businessProcessItem = (BusinessProcessItem) updatedProperty.getItem();
DiagramResourceManager diagramResourceManager = new DiagramResourceManager(getActivePage(), new NullProgressMonitor());
IFile file = diagramResourceManager.createDiagramFile();
diagramResourceManager.updateResource(businessProcessItem, file);
IEditorPart part = diagramResourceManager.openEditor(businessProcessItem, file, false);
if (part instanceof BusinessDiagramEditor) {
((BusinessDiagramEditor) part).setLastVersion(true);
}
// TDI-21143 : Studio repository view : remove all refresh call to repo view
// IRepositoryView view = getViewPart();
// if (view != null) {
// view.refresh(repositoryNode);
// }
}
}
}
use of org.talend.core.model.repository.RepositoryObject in project tdi-studio-se by Talend.
the class ExportItemWizardPage method exportDependenciesSelected.
/**
* DOC qwei Comment method "exportDependenciesSelected".
*/
private void exportDependenciesSelected() {
final Collection<Item> selectedItems = getSelectedItems();
// addTreeCheckedSelection();
IRunnableWithProgress runnable = new IRunnableWithProgress() {
@Override
public void run(final IProgressMonitor monitor) throws InvocationTargetException, InterruptedException {
//$NON-NLS-1$
monitor.beginTask("Dependencies", 100);
//
final List<IRepositoryViewObject> repositoryObjects = new ArrayList<IRepositoryViewObject>();
ProcessUtils.clearFakeProcesses();
RepositoryNodeUtilities.checkItemDependencies(selectedItems, repositoryObjects, false, true);
monitor.worked(60);
for (IRepositoryViewObject repositoryObject : repositoryObjects) {
RepositoryNode repositoryNode = RepositoryNodeUtilities.getRepositoryNode(repositoryObject, monitor);
if (repositoryNode != null) {
checkedDependency.add(repositoryNode);
} else {
implicitDependences.add(repositoryObject);
}
// check relateion ship for job -->map -->structure
for (IExtendedRepositoryNodeHandler nodeHandler : RepositoryContentManager.getExtendedNodeHandler()) {
List nodesAndDependencies = nodeHandler.getRepositoryNodeAndDependencies(repositoryObject);
if (!nodesAndDependencies.isEmpty()) {
checkedDependency.addAll(nodesAndDependencies);
}
}
}
// check relateion ship for map -->structure
for (Item item : selectedItems) {
for (IExtendedRepositoryNodeHandler nodeHandler : RepositoryContentManager.getExtendedNodeHandler()) {
List nodesAndDependencies = nodeHandler.getRepositoryNodeAndDependencies(new RepositoryObject(item.getProperty()));
if (!nodesAndDependencies.isEmpty()) {
checkedDependency.addAll(nodesAndDependencies);
}
}
}
monitor.worked(90);
ProcessUtils.clearFakeProcesses();
monitor.done();
}
};
// final ProgressMonitorJobsDialog dialog = new ProgressMonitorJobsDialog(getShell());
final ProgressMonitorDialog dialog = new ProgressMonitorDialog(getShell());
try {
dialog.run(true, true, runnable);
} catch (InvocationTargetException e) {
//
} catch (InterruptedException e) {
//
}
}
Aggregations