// Derived classes should do so if they can handle some subclasses.
// For debugging and as an example of how to use the injected _rules_engine property.
- _rules_engine.debugPrintf("Initialize() of %s", _rules_engine.getFqcn());
+ // _rules_engine.debugPrintf("Initialize() of %s", _rules_engine.getFqcn());
// If onInitialize returns false, it means it can't handle the given FQCN and
// will be unloaded.
*/
/* package */ class CanvasDropListener implements DropTargetListener {
+ private static final boolean DEBUG = false;
+
private final LayoutCanvas mCanvas;
/**
* {@inheritDoc}
*/
public void dragEnter(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drag enter", event);
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drag enter", event);
// Make sure we don't have any residual data from an earlier operation.
clearDropInfo();
* {@inheritDoc}
*/
public void dragOperationChanged(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drag changed", event);
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drag changed", event);
checkDataType(event);
recomputeDragType(event);
* {@inheritDoc}
*/
public void dragLeave(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drag leave");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drag leave");
// dragLeave is unfortunately called right before data is about to be dropped
// (between the last dropMove and the next dropAccept). That means we can't just
* {@inheritDoc}
*/
public void dropAccept(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "drop accept");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drop accept");
checkDataType(event);
* {@inheritDoc}
*/
public void drop(DropTargetEvent event) {
- AdtPlugin.printErrorToConsole("DEBUG", "dropped");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "dropped");
SimpleElement[] elements = null;
}
if (elements == null || elements.length < 1) {
- AdtPlugin.printErrorToConsole("DEBUG", "drop missing drop data");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "drop missing drop data");
return;
}
// Attempt to create a root node accordingly.
createDocumentRoot(elements);
} else {
- AdtPlugin.printErrorToConsole("DEBUG", "dropped on null targetNode");
+ if (DEBUG) AdtPlugin.printErrorToConsole("DEBUG", "dropped on null targetNode");
}
return;
}
*/
class LayoutCanvas extends Canvas implements ISelectionProvider {
+ private final static boolean DEBUG = false;
+
/* package */ static final String PREFIX_CANVAS_ACTION = "canvas_action_";
/** The layout editor that uses this layout canvas. */
}
private void debugPrintf(String message, Object... params) {
- AdtPlugin.printToConsole("Canvas", String.format(message, params));
+ if (DEBUG) AdtPlugin.printToConsole("Canvas", String.format(message, params));
}
}
// Find the descriptor for this FQCN
ViewElementDescriptor vd = getFqcnViewDescritor(viewFqcn);
if (vd == null) {
- debugPrintf("Can't create a new %s element", viewFqcn);
+ warnPrintf("Can't create a new %s element", viewFqcn);
return null;
}
// Panic ensues.
// The best bet is to abort now. The edit wrapper will release the edit and the
// XML/UI should get reloaded properly (with a likely invalid XML.)
- debugPrintf("Failed to create a new %s element", viewFqcn);
+ warnPrintf("Failed to create a new %s element", viewFqcn);
throw new RuntimeException("XML node creation failed."); //$NON-NLS-1$
}
// Find the descriptor for this FQCN
ViewElementDescriptor vd = getFqcnViewDescritor(viewFqcn);
if (vd == null) {
- debugPrintf("Can't create a new %s element", viewFqcn);
+ warnPrintf("Can't create a new %s element", viewFqcn);
return null;
}
// Panic ensues.
// The best bet is to abort now. The edit wrapper will release the edit and the
// XML/UI should get reloaded properly (with a likely invalid XML.)
- debugPrintf("Failed to create a new %s element", viewFqcn);
+ warnPrintf("Failed to create a new %s element", viewFqcn);
throw new RuntimeException("XML node creation failed."); //$NON-NLS-1$
}
return null;
}
- private void debugPrintf(String msg, Object...params) {
+ private void warnPrintf(String msg, Object...params) {
AdtPlugin.printToConsole(
mNode == null ? "Groovy" : mNode.getDescriptor().getXmlLocalName() + ".groovy",
String.format(msg, params)