|
1 | | -/******************************************************************************* |
2 | | - * Copyright (c) 2018 Microsoft Corporation and others. |
3 | | - * All rights reserved. This program and the accompanying materials |
4 | | - * are made available under the terms of the Eclipse Public License v1.0 |
5 | | - * which accompanies this distribution, and is available at |
6 | | - * http://www.eclipse.org/legal/epl-v10.html |
7 | | - * |
8 | | - * Contributors: |
9 | | - * Microsoft Corporation - initial API and implementation |
10 | | - *******************************************************************************/ |
11 | | - |
12 | | -package com.microsoft.jdtls.ext.core; |
13 | | - |
14 | | -import java.util.List; |
15 | | - |
16 | | -import org.apache.commons.lang3.StringUtils; |
17 | | -import org.eclipse.core.runtime.IProgressMonitor; |
18 | | -import org.eclipse.jdt.ls.core.internal.IDelegateCommandHandler; |
19 | | - |
20 | | -public class CommandHandler implements IDelegateCommandHandler { |
21 | | - |
22 | | - @Override |
23 | | - public Object executeCommand(String commandId, List<Object> arguments, IProgressMonitor monitor) throws Exception { |
24 | | - if (!StringUtils.isBlank(commandId)) { |
25 | | - switch (commandId) { |
26 | | - case "java.project.list": |
27 | | - return ProjectCommand.execute(arguments, monitor); |
28 | | - case "java.getPackageData": |
29 | | - return PackageCommand.getChildren(arguments, monitor); |
30 | | - case "java.resolvePath": |
31 | | - return PackageCommand.resolvePath(arguments, monitor); |
32 | | - default: |
33 | | - break; |
34 | | - } |
35 | | - } |
36 | | - throw new UnsupportedOperationException(String.format("Not supported commandId: '%s'.", commandId)); |
37 | | - } |
38 | | -} |
| 1 | +/******************************************************************************* |
| 2 | + * Copyright (c) 2018 Microsoft Corporation and others. |
| 3 | + * All rights reserved. This program and the accompanying materials |
| 4 | + * are made available under the terms of the Eclipse Public License v1.0 |
| 5 | + * which accompanies this distribution, and is available at |
| 6 | + * http://www.eclipse.org/legal/epl-v10.html |
| 7 | + * |
| 8 | + * Contributors: |
| 9 | + * Microsoft Corporation - initial API and implementation |
| 10 | + *******************************************************************************/ |
| 11 | + |
| 12 | +package com.microsoft.jdtls.ext.core; |
| 13 | + |
| 14 | +import java.util.List; |
| 15 | + |
| 16 | +import org.apache.commons.lang3.StringUtils; |
| 17 | +import org.eclipse.core.runtime.IProgressMonitor; |
| 18 | +import org.eclipse.jdt.ls.core.internal.IDelegateCommandHandler; |
| 19 | + |
| 20 | +public class CommandHandler implements IDelegateCommandHandler { |
| 21 | + |
| 22 | + @Override |
| 23 | + public Object executeCommand(String commandId, List<Object> arguments, IProgressMonitor monitor) throws Exception { |
| 24 | + if (!StringUtils.isBlank(commandId)) { |
| 25 | + switch (commandId) { |
| 26 | + case "java.project.list": |
| 27 | + return ProjectCommand.execute(arguments, monitor); |
| 28 | + case "java.getPackageData": |
| 29 | + return PackageCommand.getChildren(arguments, monitor); |
| 30 | + case "java.resolvePath": |
| 31 | + return PackageCommand.resolvePath(arguments, monitor); |
| 32 | + default: |
| 33 | + break; |
| 34 | + } |
| 35 | + } |
| 36 | + throw new UnsupportedOperationException(String.format("Not supported commandId: '%s'.", commandId)); |
| 37 | + } |
| 38 | +} |
0 commit comments