public final class ProgramReceiveTarget extends Object
public ProgramReceiveTarget(ProgramReceiveIf receiveIf, String name, String targetId)
.
The receiveIf
is you Plugin, the name
is the name the user will be see for selection
of the target and the targetId
is a unique id which is used for identifying the target.getProgramReceiveTargets()
.
public boolean canReceiveProgramsWithTarget() {
return true;
}
public boolean receivePrograms(Program[] programArr, ProgramReceiveTarget receiveTarget) {
ProgramReceiveTarget[] targets = getSupportedTargets();
if(targets[0].equals(receiveTarget)
showProgramsInDialog(programArr);
else if (targets[1].equals(receiveTarget)
for(Program p : programArr)
p.mark(this);
}
public ProgramReceiveTarget[] getProgramReceiveTargets() {
return getSupportedTargets();
}
getSupportedTargets()
looks like this:private ProgramReceiveTarget[] getSupportedTargets() {
ProgramReceiveTarget target1 = new ProgramReceiveTarget(this,"Show programs in dialog","showDialog");
ProgramReceiveTarget target2 = new ProgramReceiveTarget(this,"Mark programs for MyPlugin","markPrograms");
return new ProgramReceiveTarget[] {target1,target2};
}
Constructor and Description |
---|
ProgramReceiveTarget(ObjectInputStream in)
Creates an instance of the ProgramReceiveTarget.
|
ProgramReceiveTarget(ProgramReceiveIf receiveIf,
String name,
String targetId)
Creates an instance of the ProgramReceiveTarget.
|
Modifier and Type | Method and Description |
---|---|
static ProgramReceiveTarget[] |
createDefaultTargetArrayForProgramReceiveIf(ProgramReceiveIf receiveIf)
Creates the default target for a ProgramReceiveIf.
|
static ProgramReceiveTarget |
createDefaultTargetForProgramReceiveIfId(String receiveIfId)
Creates the default target for an id od a ProgramReceiveIf.
|
boolean |
equals(Object o) |
ProgramReceiveIf |
getReceifeIfForIdOfTarget() |
String |
getReceiveIfId() |
String |
getTargetId() |
static boolean |
isDefaultProgramReceiveTargetForProgramReceiveIf(ProgramReceiveIf receiveIf,
ProgramReceiveTarget receiveTarget)
Checks if the given target is the default target for the given ProgramReceiveIf.
|
boolean |
isReceiveTargetWithIdOfProgramReceiveIf(ProgramReceiveIf receiveIf,
String id)
Checks if the given id is used by this instance of ProgramReceiveTarget
and contains to the given ProgramReceiveIf.
|
String |
toString() |
void |
writeData(ObjectOutputStream out)
Use this to save a target.
|
public ProgramReceiveTarget(ProgramReceiveIf receiveIf, String name, String targetId)
receiveIf
- The ProgramReceiveIf (your Plugin) to create for.name
- The name of the target.targetId
- The unique id of the target.public ProgramReceiveTarget(ObjectInputStream in) throws IOException, ClassNotFoundException
writeData(ObjectOutputStream)
.in
- The input stream.IOException
ClassNotFoundException
public static ProgramReceiveTarget[] createDefaultTargetArrayForProgramReceiveIf(ProgramReceiveIf receiveIf)
receiveIf
- The ProgramReceiveIf to create the null target for.public static ProgramReceiveTarget createDefaultTargetForProgramReceiveIfId(String receiveIfId)
receiveIfId
- The id of the ProgramReceiveIf to create for.public void writeData(ObjectOutputStream out) throws IOException
out
- IOException
public String getReceiveIfId()
public String getTargetId()
public ProgramReceiveIf getReceifeIfForIdOfTarget()
public static boolean isDefaultProgramReceiveTargetForProgramReceiveIf(ProgramReceiveIf receiveIf, ProgramReceiveTarget receiveTarget)
receiveIf
- The ProgramReceiveIf to check.receiveTarget
- The ProgramReceiveTarget to check.public boolean isReceiveTargetWithIdOfProgramReceiveIf(ProgramReceiveIf receiveIf, String id)
id
- The id to check.receiveIf
- The receive if to which the ProgramReceiveTarget is connected.TV-Browser 2.7.6, Copyright (C) 04-2003 Martin Oberhauser (martin@tvbrowser.org)