/tools/plugins/com.liferay.ide.project.core/src/com/liferay/ide/project/core/BinaryProjectImportDataModelProvider.java

https://gitlab.com/4615833/liferay-ide · Java · 70 lines · 32 code · 10 blank · 28 comment · 0 complexity · 163f45d8878735d6d2e178a59160a2f5 MD5 · raw file

  1. /*******************************************************************************
  2. * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
  3. *
  4. * This library is free software; you can redistribute it and/or modify it under
  5. * the terms of the GNU Lesser General Public License as published by the Free
  6. * Software Foundation; either version 2.1 of the License, or (at your option)
  7. * any later version.
  8. *
  9. * This library is distributed in the hope that it will be useful, but WITHOUT
  10. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  11. * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
  12. * details.
  13. *
  14. * Contributors:
  15. * Kamesh Sampath - initial implementation
  16. * Cindy Li - IDE-692
  17. ******************************************************************************/
  18. package com.liferay.ide.project.core;
  19. import com.liferay.ide.project.core.util.ProjectUtil;
  20. import org.eclipse.core.runtime.IStatus;
  21. import org.eclipse.osgi.util.NLS;
  22. import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
  23. /**
  24. * @author <a href="mailto:kamesh.sampath@hotmail.com">Kamesh Sampath</a>
  25. */
  26. public class BinaryProjectImportDataModelProvider extends SDKProjectsImportDataModelProvider
  27. {
  28. /*
  29. * (non-Javadoc)
  30. * @see com.liferay.ide.project.core.SDKProjectsImportDataModelProvider#createProjectErrorStatus()
  31. */
  32. @Override
  33. public IStatus createSelectedProjectsErrorStatus()
  34. {
  35. return ProjectCore.createErrorStatus( Msgs.selectBinary );
  36. }
  37. /*
  38. * (non-Javadoc)
  39. * @see com.liferay.ide.project.core.LiferayProjectImportDataModelProvider#getDefaultOperation()
  40. */
  41. @Override
  42. public IDataModelOperation getDefaultOperation()
  43. {
  44. return new BinaryProjectImportOperation( this.model );
  45. }
  46. @Override
  47. public void init()
  48. {
  49. super.init();
  50. ProjectUtil.setDefaultRuntime(getDataModel());
  51. }
  52. private static class Msgs extends NLS
  53. {
  54. public static String selectBinary;
  55. static
  56. {
  57. initializeMessages( BinaryProjectImportDataModelProvider.class.getName(), Msgs.class );
  58. }
  59. }
  60. }