use of org.jboss.ide.eclipse.archives.core.model.IArchiveNode in project jbosstools-server by jbosstools.
the class ArchiveInfoWizardPage method fillDefaults.
private void fillDefaults() {
if (archive != null) {
compressedButton.setSelection(!archive.isExploded());
explodedButton.setSelection(archive.isExploded());
packageNameText.setText(archive.getName());
packageName = archive.getName();
explodedButton.setSelection(archive.isExploded());
compressedButton.setSelection(!archive.isExploded());
IArchiveNode parent = archive.getParent();
if (parent != null && !(parent instanceof IArchiveModelRootNode)) {
destinationComposite.init(parent);
} else {
destinationComposite.init(archive.getRawDestinationPath(), archive.isDestinationInWorkspace());
}
} else {
if (wizard.getInitialNode() != null)
destinationComposite.init(wizard.getInitialNode());
else
destinationComposite.init(wizard.getInitialPath(), wizard.isInitialPathWorkspaceRelative());
}
}
use of org.jboss.ide.eclipse.archives.core.model.IArchiveNode in project jbosstools-server by jbosstools.
the class ModelCreationTest method testAddFilesetToLibFileset.
public void testAddFilesetToLibFileset() {
try {
IArchive archive = createArchive("someName.war", "test");
IArchiveFileSet fs = createLibFileSet("path");
IArchiveNode child = createFileSet("*", "path");
archive.addChild(fs);
fs.addChild(child);
createEmptyModelNode().addChild(archive);
} catch (ArchivesModelException ame) {
return;
}
fail();
}
use of org.jboss.ide.eclipse.archives.core.model.IArchiveNode in project jbosstools-server by jbosstools.
the class ModelCreationTest method testAddFolderToFileset.
public void testAddFolderToFileset() {
try {
IArchive archive = createArchive("someName.war", "test");
IArchiveFileSet fs = createFileSet("*", "path");
IArchiveNode child = createFolder("test");
archive.addChild(fs);
fs.addChild(child);
createEmptyModelNode().addChild(archive);
} catch (ArchivesModelException ame) {
return;
}
fail();
}
use of org.jboss.ide.eclipse.archives.core.model.IArchiveNode in project jbosstools-server by jbosstools.
the class ModelCreationTest method testAddFilesetToFileset.
public void testAddFilesetToFileset() {
try {
IArchive archive = createArchive("someName.war", "test");
IArchiveFileSet fs = createFileSet("*", "path");
IArchiveNode child = createFileSet("*", "path");
archive.addChild(fs);
fs.addChild(child);
createEmptyModelNode().addChild(archive);
} catch (ArchivesModelException ame) {
return;
}
fail();
}
use of org.jboss.ide.eclipse.archives.core.model.IArchiveNode in project jbosstools-server by jbosstools.
the class ArchiveNodeDeltaImpl method loadAllAffectedChildren.
private void loadAllAffectedChildren() {
ArrayList priorChildren = new ArrayList();
// first add the deltas for things that are currently our children
// this includes items that haven't been changed, and items that were added
IArchiveNode[] children = postNode.getAllChildren();
IArchiveNodeDelta delta;
ArrayList deltas = new ArrayList();
for (int i = 0; i < children.length; i++) {
// create our child delta before evaluating whether or not to add it
delta = getDelta(children[i]);
if (delta.getKind() != IArchiveNodeDelta.NO_CHANGE) {
deltas.add(delta);
if (((delta.getKind() & IArchiveNodeDelta.ADDED) == 0) && ((delta.getKind() & IArchiveNodeDelta.REMOVED) == 0)) {
kind = kind | DESCENDENT_CHANGED;
}
}
// add ALL current nodes, then later remove the added ones
priorChildren.add(delta.getPreNode());
}
// now handle the removed ones
ArchiveNodeImpl node;
for (Iterator i = this.children.keySet().iterator(); i.hasNext(); ) {
node = (ArchiveNodeImpl) i.next();
int v = ((Integer) this.children.get(node)).intValue();
if (v == IArchiveNodeDelta.CHILD_REMOVED) {
delta = getDelta(node);
deltas.add(delta);
priorChildren.add(delta.getPreNode());
} else if (v == IArchiveNodeDelta.CHILD_ADDED) {
delta = getDelta(node);
priorChildren.remove(delta.getPreNode());
}
}
if (preNode != null) {
// now we've got our list of current children... set them.
for (Iterator i = priorChildren.iterator(); i.hasNext(); ) {
try {
preNode.addChild((IArchiveNode) i.next());
} catch (ArchivesModelException ame) {
// DO nothing
}
}
// now clear pre-node's deltas so it looks shiny
preNode.clearDelta();
}
childrenDeltas = (IArchiveNodeDelta[]) deltas.toArray(new IArchiveNodeDelta[deltas.size()]);
}
Aggregations