diff options
author | eyuen | 2014-04-16 21:33:53 +0000 |
---|---|---|
committer | eyuen | 2014-04-16 21:33:53 +0000 |
commit | 16e76037949ee725326a8de6af8ff9b725273fa9 (patch) | |
tree | 5bf6d8fcd87b5395e5622b2bb867b51acf59e6fb | |
parent | 32c547f77b8407a9b5f91607bfeb102f07d420dc (diff) | |
download | webtools.servertools-16e76037949ee725326a8de6af8ff9b725273fa9.tar.gz webtools.servertools-16e76037949ee725326a8de6af8ff9b725273fa9.tar.xz webtools.servertools-16e76037949ee725326a8de6af8ff9b725273fa9.zip |
[431973] ServerEditorOverviewPageModifier has no access tov20140416_1734
commandManager
2 files changed, 31 insertions, 2 deletions
diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java index fe9488af1..fbbb1ce04 100644 --- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java +++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/editor/ServerEditorOverviewPageModifier.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010 IBM Corporation and others. + * Copyright (c) 2010, 2014 IBM Corporation and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -10,9 +10,12 @@ *******************************************************************************/ package org.eclipse.wst.server.ui.editor; +import org.eclipse.core.commands.operations.IUndoableOperation; import org.eclipse.swt.widgets.Composite; +import org.eclipse.ui.forms.widgets.FormToolkit; import org.eclipse.wst.server.core.IServerWorkingCopy; import org.eclipse.wst.server.ui.AbstractUIControl; +import org.eclipse.wst.server.ui.internal.Trace; /** * A modifier class that allows adopter to modify the behaviour of a UI control on the @@ -22,7 +25,8 @@ import org.eclipse.wst.server.ui.AbstractUIControl; */ public abstract class ServerEditorOverviewPageModifier extends AbstractUIControl { protected IServerWorkingCopy serverWc = null; - + private FormToolkit serverEditorFormToolkit = null; + private ServerEditorPart serverEditorPart = null; /** * The list of editor sections on the server editors that allow inserting custom GUI. @@ -47,4 +51,27 @@ public abstract class ServerEditorOverviewPageModifier extends AbstractUIControl public void setServerWorkingCopy(IServerWorkingCopy curServerWc) { serverWc = curServerWc; } + + public void setServerEditorPart(ServerEditorPart part) { + serverEditorPart = part; + } + + public void setFormToolkit(FormToolkit toolkit) { + this.serverEditorFormToolkit = toolkit; + } + + protected FormToolkit getFormToolkit() { + return serverEditorFormToolkit; + } + + protected void executeCommand(IUndoableOperation operation) { + if (serverEditorPart != null) { + serverEditorPart.execute(operation); + } else { + if (Trace.SEVERE) { + Trace.trace(Trace.STRING_SEVERE, + "Error executing command: No reference to editor part"); + } + } + } }
\ No newline at end of file diff --git a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java index 6d35caba9..5889085c1 100644 --- a/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java +++ b/plugins/org.eclipse.wst.server.ui/serverui/org/eclipse/wst/server/ui/internal/editor/OverviewEditorPart.java @@ -612,6 +612,8 @@ public class OverviewEditorPart extends ServerEditorPart implements IUIControlLi for (ServerEditorOverviewPageModifier curPageModifier : pageModifiersLst) { if(server != null && server.getServerType() != null){ curPageModifier.setServerWorkingCopy(server); + curPageModifier.setServerEditorPart(this); + curPageModifier.setFormToolkit(toolkit); curPageModifier.createControl(ServerEditorOverviewPageModifier.UI_LOCATION.OVERVIEW, composite); curPageModifier.setUIControlListener(this); } |