projects
/
Mograsim.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
9ab92f6
)
Marked fields/methods related to activeMachine as deprecated in MContext
author
Daniel Kirschten
<daniel.kirschten@gmx.de>
Mon, 30 Sep 2019 16:55:59 +0000
(18:55 +0200)
committer
Daniel Kirschten
<daniel.kirschten@gmx.de>
Mon, 30 Sep 2019 16:55:59 +0000
(18:55 +0200)
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContext.java
patch
|
blob
|
history
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContextStatus.java
patch
|
blob
|
history
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContext.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContext.java
index
c84e622
..
147b244
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContext.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContext.java
@@
-40,10
+40,12
@@
public class MachineContext
final ScopedPreferenceStore prefs;
Optional<String> machineId = Optional.empty();
Optional<MachineDefinition> machineDefinition = Optional.empty();
final ScopedPreferenceStore prefs;
Optional<String> machineId = Optional.empty();
Optional<MachineDefinition> machineDefinition = Optional.empty();
+ @Deprecated(forRemoval = true)
Optional<Machine> activeMachine = Optional.empty();
private MachineContextStatus status = UNKOWN;
Optional<Machine> activeMachine = Optional.empty();
private MachineContextStatus status = UNKOWN;
+ @Deprecated(forRemoval = true)
private final Set<ActiveMachineListener> machineListeners = new HashSet<>();
private final Set<MachineContextStatusListener> stateListeners = new HashSet<>();
private final Set<ActiveMachineListener> machineListeners = new HashSet<>();
private final Set<MachineContextStatusListener> stateListeners = new HashSet<>();
@@
-86,6
+88,7
@@
public class MachineContext
/**
* Returns true if a machine is instantiated and (possibly) running
*/
/**
* Returns true if a machine is instantiated and (possibly) running
*/
+ @Deprecated(forRemoval = true)
public final boolean isActive()
{
return status == ACTIVE || status == ACTIVE_CHANGED;
public final boolean isActive()
{
return status == ACTIVE || status == ACTIVE_CHANGED;
@@
-120,6
+123,7
@@
public class MachineContext
/**
* Sets the active machine in the {@link MachineContext}'s project scope.
*/
/**
* Sets the active machine in the {@link MachineContext}'s project scope.
*/
+ @Deprecated(forRemoval = true)
public final void setActiveMachine(Machine machine)
{
Optional<Machine> oldMachine = activeMachine;
public final void setActiveMachine(Machine machine)
{
Optional<Machine> oldMachine = activeMachine;
@@
-138,6
+142,7
@@
public class MachineContext
return machineDefinition;
}
return machineDefinition;
}
+ @Deprecated(forRemoval = true)
public final Optional<Machine> getActiveMachine()
{
// activateMachine(); // TODO is this the best way to deal with this?
public final Optional<Machine> getActiveMachine()
{
// activateMachine(); // TODO is this the best way to deal with this?
@@
-150,6
+155,7
@@
public class MachineContext
*
* @return true if the activation was successful
*/
*
* @return true if the activation was successful
*/
+ @Deprecated(forRemoval = true)
public final boolean activateMachine()
{
if (status == ACTIVE)
public final boolean activateMachine()
{
if (status == ACTIVE)
@@
-188,6
+194,7
@@
public class MachineContext
*
* @return the raw status of the project at the time of the call.
*/
*
* @return the raw status of the project at the time of the call.
*/
+ @SuppressWarnings("removal")
public final MachineContextStatus reevaluateStatus()
{
if (!owner.exists())
public final MachineContextStatus reevaluateStatus()
{
if (!owner.exists())
@@
-205,6
+212,7
@@
public class MachineContext
return ACTIVE;
}
return ACTIVE;
}
+ @Deprecated(forRemoval = true)
private void doPostStatusChangedAction()
{
if ((status == DEAD || status == CLOSED) && activeMachine.isPresent())
private void doPostStatusChangedAction()
{
if ((status == DEAD || status == CLOSED) && activeMachine.isPresent())
@@
-249,17
+257,20
@@
public class MachineContext
}
}
}
}
+ @Deprecated(forRemoval = true)
private void notifyActiveMachineListeners(Optional<Machine> oldMachine, Optional<Machine> newMachine)
{
machineListeners.forEach(ob -> ob.setMachine(oldMachine, newMachine));
}
private void notifyActiveMachineListeners(Optional<Machine> oldMachine, Optional<Machine> newMachine)
{
machineListeners.forEach(ob -> ob.setMachine(oldMachine, newMachine));
}
+ @Deprecated(forRemoval = true)
public void addActiveMachineListener(ActiveMachineListener ob)
{
machineListeners.add(ob);
ob.setMachine(Optional.empty(), activeMachine);
}
public void addActiveMachineListener(ActiveMachineListener ob)
{
machineListeners.add(ob);
ob.setMachine(Optional.empty(), activeMachine);
}
+ @Deprecated(forRemoval = true)
public void removeActiveMachineListener(ActiveMachineListener ob)
{
machineListeners.remove(ob);
public void removeActiveMachineListener(ActiveMachineListener ob)
{
machineListeners.remove(ob);
@@
-282,6
+293,7
@@
public class MachineContext
}
@FunctionalInterface
}
@FunctionalInterface
+ @Deprecated(forRemoval = true)
public static interface ActiveMachineListener
{
void setMachine(Optional<Machine> oldMachine, Optional<Machine> newMachine);
public static interface ActiveMachineListener
{
void setMachine(Optional<Machine> oldMachine, Optional<Machine> newMachine);
diff --git
a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContextStatus.java
b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContextStatus.java
index
37c50a3
..
6adf912
100644
(file)
--- a/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContextStatus.java
+++ b/
plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/nature/MachineContextStatus.java
@@
-5,14
+5,16
@@
public enum MachineContextStatus
/**
* A machine is currently associated and maybe running.
*/
/**
* A machine is currently associated and maybe running.
*/
+ @Deprecated(forRemoval = true)
ACTIVE,
/**
* A machine is currently associated and maybe running, but its ID does not match the current definition.
*/
ACTIVE,
/**
* A machine is currently associated and maybe running, but its ID does not match the current definition.
*/
+ @Deprecated(forRemoval = true)
ACTIVE_CHANGED,
/**
ACTIVE_CHANGED,
/**
- * The project can be actively used. The project must exist, be currently valid (uses a machine id that is known to Mograsim at
- *
runtime)
and opened.
+ * The project can be actively used. The project must exist, be currently valid (uses a machine id that is known to Mograsim at
runtime)
+ * and opened.
*/
READY,
/**
*/
READY,
/**