Skip to content
Snippets Groups Projects
Commit c1f3be54 authored by Simon Barner's avatar Simon Barner
Browse files

Merge branch '3994' into 'master'

CLI for shutting down the platform

See merge request !115
parents b9505765 6fa0ea5e
No related branches found
No related tags found
1 merge request!115CLI for shutting down the platform
ToolingBaseUIActivator.java dbb6f64b87a553ffbcfeb92160d84b63073dfd89 GREEN
ToolingBaseUIActivator.java d961cd206d8f44e851b2211430b25fee3d9071c0 GREEN
......@@ -19,6 +19,8 @@ import static org.eclipse.jface.resource.ResourceLocator.imageDescriptorFromBund
import org.eclipse.jface.resource.ImageDescriptor;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.fortiss.tooling.base.ui.cli.ShutdownPlatformCLIHandler;
import org.fortiss.tooling.kernel.service.ICommandLineInterfaceService;
import org.osgi.framework.BundleContext;
/**
......@@ -39,6 +41,9 @@ public class ToolingBaseUIActivator extends AbstractUIPlugin {
super.start(context);
plugin = this;
System.out.println("[Plugin] " + PLUGIN_ID + " started.");
ICommandLineInterfaceService cliService = ICommandLineInterfaceService.getInstance();
cliService.registerHandler("--shutdown", new ShutdownPlatformCLIHandler());
}
/** {@inheritDoc} */
......
ShutdownPlatformCLIHandler.java ea3d5d4522efcb01b66a9b0a3481739d71efb278 GREEN
/*-------------------------------------------------------------------------+
| Copyright 2020 fortiss GmbH |
| |
| Licensed under the Apache License, Version 2.0 (the "License"); |
| you may not use this file except in compliance with the License. |
| You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, software |
| distributed under the License is distributed on an "AS IS" BASIS, |
| WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| See the License for the specific language governing permissions and |
| limitations under the License. |
+--------------------------------------------------------------------------*/
package org.fortiss.tooling.base.ui.cli;
import static org.eclipse.ui.PlatformUI.getWorkbench;
import org.fortiss.tooling.kernel.extension.ICommandLineSwitchHandler;
/**
* Enables users of the CLI to trigger a platform shutdown after the preceding CLI switches were
* handled. Useful for automation tasks.
*
* @author diewald
*/
public class ShutdownPlatformCLIHandler implements ICommandLineSwitchHandler {
/** {@inheritDoc} */
@Override
public boolean hasAdditionalArgument() {
return false;
}
/** {@inheritDoc} */
@Override
public void handleCLISwitch(String argument) {
getWorkbench().close();
}
}
......@@ -6,7 +6,7 @@ EllipseLayoutUIUtils.java 4dd9dbd96a45e8c455c019caa19e4a50f18336af GREEN
FXDNDUtils.java 6ce94e239e68f9e2b3cc0524b072606f4a120076 GREEN
FontUtils.java a167a05bdaa8da9853705cc5134f30f6d81bc9f2 GREEN
GCStateManager.java 983973a92376b5c757c1253b32e33d0666ccdf7b GREEN
LWFXEditorUtils.java 32b62765bec43e610e49d11213d58285ccfe9b06 YELLOW
LWFXEditorUtils.java 32b62765bec43e610e49d11213d58285ccfe9b06 GREEN
LayoutDataUIUtils.java c85886ac313a6efb122532218eb134047ffd6631 GREEN
PropertiesViewUtils.java d345b4501c4092228edf1c98e0189317d53aaf22 GREEN
RectangleLayoutUIUtils.java ef4b872bb5b4a51174e9a29d9ef05e7cb3bff3a1 GREEN
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment