use of org.talend.designer.runtime.visualization.ISnapshot in project tdi-studio-se by Talend.
the class DeleteAction method run.
/*
* @see Action#run()
*/
@Override
public void run() {
if (!confirm()) {
return;
}
// delete JVMs
deleteJvms();
// delete remote hosts
for (IHost host : remoteHosts) {
jvms = host.getTerminatedJvms();
deleteJvms();
}
for (IHost host : remoteHosts) {
JvmModel.getInstance().removeHost(host);
}
// delete snapshots
for (ISnapshot snapshot : snapshots) {
closeEditor(snapshot.getFileStore());
snapshot.getJvm().deleteSnapshot(snapshot);
}
treeViewer.refresh();
}
use of org.talend.designer.runtime.visualization.ISnapshot in project tdi-studio-se by Talend.
the class AbstractJvm method refreshSnapshots.
/**
* Refreshes the snapshots.
*/
protected void refreshSnapshots() {
snapshots = new ArrayList<ISnapshot>();
IPath baseDirectory;
try {
baseDirectory = getBaseDirectory();
} catch (JvmCoreException e) {
// do nothing
return;
}
File[] files = baseDirectory.toFile().listFiles();
if (files == null) {
return;
}
for (File file : files) {
String fileName = file.getName();
if (Snapshot.isValidFile(fileName)) {
Snapshot snapshot = new Snapshot(Util.getFileStore(fileName, baseDirectory), this);
snapshots.add(snapshot);
}
}
}
use of org.talend.designer.runtime.visualization.ISnapshot in project tdi-studio-se by Talend.
the class JvmTreeLabelProvider method getStyledText.
/*
* @see IStyledLabelProvider#getStyledText(Object)
*/
@Override
public StyledString getStyledText(Object element) {
StyledString text = new StyledString();
if (element instanceof IJvm) {
//$NON-NLS-1$
String prefix = "";
String mainClass = ((IJvm) element).getMainClass();
String suffix = getIdInicator((IJvm) element);
if (element instanceof ITerminatedJvm) {
//$NON-NLS-1$
prefix = "<terminated>";
}
text.append(prefix).append(mainClass).append(suffix);
text.setStyle(prefix.length() + mainClass.length(), suffix.length(), StyledString.DECORATIONS_STYLER);
} else if (element instanceof ISnapshot) {
String fileName = ((ISnapshot) element).getFileStore().getName();
text.append(fileName);
String date = ((ISnapshot) element).getTimeStamp();
if (date != null) {
//$NON-NLS-1$ //$NON-NLS-2$
text.append(" (").append(date).append(")");
}
} else {
text.append(element.toString());
}
return text;
}
Aggregations