use of org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob in project jbosstools-server by jbosstools.
the class ArchivesActionProvider method deleteSelectedNodes.
private void deleteSelectedNodes() {
IArchiveNode[] node = getSelectedNodes(site);
if (node != null && node.length > 0 && approveDeletion(node)) {
ArrayList<IPath> paths = new ArrayList<IPath>();
for (int i = 0; i < node.length; i++) {
final IArchiveNode parent = (IArchiveNode) node[i].getParent();
parent.removeChild(node[i]);
if (!paths.contains(parent.getProjectPath()))
paths.add(parent.getProjectPath());
}
Iterator<IPath> pit = paths.iterator();
while (pit.hasNext()) {
new SaveArchivesJob(pit.next()).schedule();
}
}
}
use of org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob in project jbosstools-server by jbosstools.
the class JDTArchivesActionProvider method deleteSelectedNode.
private void deleteSelectedNode() {
IArchiveNode node = getSelectedNode();
if (node != null) {
final IArchiveNode parent = (IArchiveNode) node.getParent();
parent.removeChild(node);
SaveArchivesJob job = new SaveArchivesJob(parent.getProjectPath());
job.schedule();
}
}
use of org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob in project jbosstools-server by jbosstools.
the class ArchivesActionProvider method editSelectedNode.
private void editSelectedNode() {
IArchiveNode node = getSelectedNode(site);
if (node != null) {
if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FILESET && node instanceof IArchiveStandardFileSet) {
IArchiveStandardFileSet fileset = (IArchiveStandardFileSet) node;
WizardDialog dialog = new WizardDialog(getShell(), new FilesetWizard(fileset, node.getParent()));
dialog.open();
} else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE && node instanceof IArchive) {
IArchive pkg = (IArchive) node;
WizardDialog dialog = new WizardDialog(getShell(), new NewJARWizard(pkg));
dialog.open();
} else if (node.getNodeType() == IArchiveNode.TYPE_ARCHIVE_FOLDER && node instanceof IArchiveFolder) {
// folder can do the model save here.
IArchiveFolder folder = (IArchiveFolder) node;
InputDialog dialog = new InputDialog(getShell(), ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title, ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, folder.getName(), null);
int response = dialog.open();
if (response == Dialog.OK) {
folder.setName(dialog.getValue());
new SaveArchivesJob(folder.getProjectPath()).schedule();
}
}
}
}
use of org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob in project jbosstools-server by jbosstools.
the class ArchivesActionProvider method createFolder.
/*
* Methods below are called from the standard actions,
* the implementations of the action, where the action does its work etc
*/
private void createFolder() {
IInputValidator validator = new IInputValidator() {
public String isValid(String newText) {
IArchiveNode selected = getSelectedNode(site);
boolean folderExists = false;
IArchiveNode[] folders = selected.getChildren(IArchiveNode.TYPE_ARCHIVE_FOLDER);
for (int i = 0; i < folders.length; i++) {
IArchiveFolder folder = (IArchiveFolder) folders[i];
if (folder.getName().equals(newText)) {
folderExists = true;
break;
}
}
if (folderExists) {
return NLS.bind(ArchivesUIMessages.ProjectPackagesView_createFolderDialog_warnFolderExists, newText);
}
if ("".equals(newText)) {
// $NON-NLS-1$
return ArchivesUIMessages.ProjectPackagesView_createFolderDialog_blank;
}
return null;
}
};
InputDialog dialog = new InputDialog(getShell(), ArchivesUIMessages.ProjectPackagesView_createFolderDialog_title, ArchivesUIMessages.ProjectPackagesView_createFolderDialog_message, "", // $NON-NLS-1$
validator);
int response = dialog.open();
if (response == Dialog.OK) {
// $NON-NLS-1$
String[] folderPaths = dialog.getValue().split("[\\\\/]");
IArchiveNode selected = getSelectedNode(site);
IArchiveFolder current = null;
IArchiveFolder temp = null;
for (int i = folderPaths.length - 1; i >= 0; i--) {
temp = ArchivesCore.getInstance().getNodeFactory().createFolder();
temp.setName(folderPaths[i]);
if (current == null)
current = temp;
else {
temp.addChild(current);
current = temp;
}
}
selected.addChild(current);
new SaveArchivesJob(selected.getProjectPath()).schedule();
}
}
use of org.jboss.ide.eclipse.archives.core.build.SaveArchivesJob in project jbosstools-server by jbosstools.
the class ArchivePublishWizard method performFinish.
public boolean performFinish() {
boolean alwaysPublish = new Boolean(page.getAlwaysPublish()).booleanValue();
pack.setProperty(ArchivesModuleModelListener.DEPLOY_SERVERS, alwaysPublish ? getServers() : null);
pack.setProperty(ArchivesModuleModelListener.DEPLOY_AFTER_BUILD, getAutoDeploy());
final IPath p = pack.getProjectPath();
new SaveArchivesJob(p).schedule();
return true;
}
Aggregations