Methods Summary |
---|
private void | createDropTarget(org.eclipse.swt.widgets.Control control)
DropTarget dropTarget = new DropTarget(control, DND.DROP_DEFAULT | DND.DROP_MOVE | DND.DROP_COPY | DND.DROP_LINK);
dropTarget.setTransfer(new Transfer[] { URLTransfer.getInstance(), FileTransfer.getInstance()});
dropTarget.addDropListener(new DropTargetAdapter() {
public void dragOver(DropTargetEvent event) {
if(URLTransfer.getInstance().isSupportedType(event.currentDataType)) {
event.detail = getCurrentPanel() instanceof ModePanel ? DND.DROP_LINK : DND.DROP_NONE;
}
}
public void drop(DropTargetEvent event) {
if (event.data instanceof String[]) {
String[] sourceNames = (String[]) event.data;
if (sourceNames == null || sourceNames.length != 1)
event.detail = DND.DROP_NONE;
if (event.detail == DND.DROP_NONE)
return;
File droppedFile = new File(sourceNames[0]);
if (getCurrentPanel() instanceof ModePanel) {
if (droppedFile.isFile()) {
singlePath = droppedFile.getAbsolutePath();
((ModePanel) getCurrentPanel()).activateMode(true);
} else if (droppedFile.isDirectory()) {
directoryPath = droppedFile.getAbsolutePath();
((ModePanel) getCurrentPanel()).activateMode(false);
}
} else if (getCurrentPanel() instanceof DirectoryPanel) {
if (droppedFile.isDirectory())
((DirectoryPanel) getCurrentPanel()).setFilename(droppedFile.getAbsolutePath());
} else if (getCurrentPanel() instanceof SingleFilePanel) {
if (droppedFile.isFile())
((SingleFilePanel) getCurrentPanel()).setFilename(droppedFile.getAbsolutePath());
}
} else if (getCurrentPanel() instanceof ModePanel) {
trackerURL = ((URLTransfer.URLType)event.data).linkURL;
((ModePanel) getCurrentPanel()).updateTrackerURL();
}
}
});
|
protected boolean | getAddOtherHashes()
return( addOtherHashes );
|
java.lang.String | getComment()
return (comment);
|
protected java.lang.String | getDefaultOpenDir()
return( default_open_dir );
|
protected java.lang.String | getDefaultSaveDir()
return( default_save_dir );
|
public boolean | getPieceSizeComputed()
return( computed_piece_size );
|
protected long | getPieceSizeManual()
return( manual_piece_size );
|
protected int | getTrackerType()
return( tracker_type );
|
protected void | setAddOtherHashes(boolean o)
addOtherHashes = o;
COConfigurationManager.setParameter( "CreateTorrent.default.addhashes", addOtherHashes );
|
void | setComment(java.lang.String s)
comment = s;
COConfigurationManager.setParameter("CreateTorrent.default.comment",comment);
|
protected void | setDefaultOpenDir(java.lang.String d)
default_open_dir = d;
COConfigurationManager.setParameter( "CreateTorrent.default.open", default_open_dir );
|
protected void | setDefaultSaveDir(java.lang.String d)
default_save_dir = d;
COConfigurationManager.setParameter( "CreateTorrent.default.save", default_save_dir );
|
protected void | setPieceSizeComputed()
computed_piece_size = true;
|
protected void | setPieceSizeManual(long _value)
computed_piece_size = false;
manual_piece_size = _value;
|
protected void | setTrackerType(int type)
tracker_type = type;
COConfigurationManager.setParameter( "CreateTorrent.default.trackertype", tracker_type );
|