* <li>When <code>LayoutData</code> has all default values, then we can delete it at all.</li>
* </ul>
*/
private void turnIntoBlock_whenEnsureVariable() {
// no invocations/fields -> inline
addBroadcastListener(new ObjectEventListener() {
@Override
public void endEdit_aboutToRefresh() throws Exception {
if (getVariableSupport() instanceof LocalUniqueVariableSupport) {
LocalUniqueVariableSupport variableSupport =
(LocalUniqueVariableSupport) getVariableSupport();
if (variableSupport.canInline()) {
variableSupport.inline();
}
}
}
});
// is default -> delete
addBroadcastListener(new ObjectEventListener() {
@Override
public void endEdit_aboutToRefresh() throws Exception {
if (!isDeleted()
&& getCreationSupport() instanceof ConstructorCreationSupport
&& getMethodInvocations().isEmpty()