Search in sources :

Example 26 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class GroupIdValidationService method compute.

@Override
protected Status compute() {
    NewLiferayPluginProjectOp op = _op();
    NewLiferayProjectProvider<NewLiferayPluginProjectOp> provider = op.getProjectProvider().content(true);
    if ("maven".equals(provider.getShortName())) {
        String groupId = op.getGroupId().content(true);
        IStatus javaStatus = JavaConventions.validatePackageName(groupId, CompilerOptions.VERSION_1_7, CompilerOptions.VERSION_1_7);
        return StatusBridge.create(javaStatus);
    }
    return StatusBridge.create(org.eclipse.core.runtime.Status.OK_STATUS);
}
Also used : IStatus(org.eclipse.core.runtime.IStatus) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 27 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class PluginTypeValidationService method initValidationService.

@Override
protected void initValidationService() {
    super.initValidationService();
    Listener listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refresh();
        }
    };
    NewLiferayPluginProjectOp op = _op();
    op.getProjectProvider().attach(listener);
}
Also used : FilteredListener(org.eclipse.sapphire.FilteredListener) PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) FilteredListener(org.eclipse.sapphire.FilteredListener) Listener(org.eclipse.sapphire.Listener) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 28 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class PortletFrameworkValidationService method dispose.

@Override
public void dispose() {
    NewLiferayPluginProjectOp op = _op();
    op.property(NewLiferayPluginProjectOp.PROP_PROJECT_PROVIDER).detach(_listener);
    super.dispose();
}
Also used : NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 29 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class PortletFrameworkValidationService method initValidationService.

@Override
protected void initValidationService() {
    super.initValidationService();
    _listener = new FilteredListener<PropertyContentEvent>() {

        @Override
        protected void handleTypedEvent(PropertyContentEvent event) {
            refresh();
        }
    };
    NewLiferayPluginProjectOp op = _op();
    op.property(NewLiferayPluginProjectOp.PROP_PROJECT_PROVIDER).attach(_listener);
}
Also used : PropertyContentEvent(org.eclipse.sapphire.PropertyContentEvent) NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Example 30 with NewLiferayPluginProjectOp

use of com.liferay.ide.project.core.model.NewLiferayPluginProjectOp in project liferay-ide by liferay.

the class NewLiferayPluginProjectMavenTests method testUseDefaultLocationEnablement.

public void testUseDefaultLocationEnablement(boolean versionRestriction) throws Exception {
    final NewLiferayPluginProjectOp op = newProjectOp("test-use-default-location-enablement");
    op.setProjectProvider("maven");
    assertEquals(true, op.getUseDefaultLocation().service(EnablementService.class).enablement());
    assertEquals(true, op.getUseDefaultLocation().enabled());
    if (versionRestriction) {
        op.setProjectProvider("ant");
        assertEquals(false, op.getUseDefaultLocation().service(EnablementService.class).enablement());
        assertEquals(false, op.getUseDefaultLocation().enabled());
    }
}
Also used : NewLiferayPluginProjectOp(com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)

Aggregations

NewLiferayPluginProjectOp (com.liferay.ide.project.core.model.NewLiferayPluginProjectOp)122 Test (org.junit.Test)61 IProject (org.eclipse.core.resources.IProject)48 IWebProject (com.liferay.ide.core.IWebProject)18 IFile (org.eclipse.core.resources.IFile)18 IPath (org.eclipse.core.runtime.IPath)14 IFolder (org.eclipse.core.resources.IFolder)13 SDK (com.liferay.ide.sdk.core.SDK)12 Status (org.eclipse.sapphire.modeling.Status)10 PropertyContentEvent (org.eclipse.sapphire.PropertyContentEvent)9 Path (org.eclipse.sapphire.modeling.Path)8 CoreException (org.eclipse.core.runtime.CoreException)7 IPortletFramework (com.liferay.ide.project.core.IPortletFramework)6 HashSet (java.util.HashSet)5 PossibleValuesService (org.eclipse.sapphire.PossibleValuesService)5 ValidationService (org.eclipse.sapphire.services.ValidationService)5 IVirtualComponent (org.eclipse.wst.common.componentcore.resources.IVirtualComponent)5 NewLiferayProfile (com.liferay.ide.project.core.model.NewLiferayProfile)4 IStatus (org.eclipse.core.runtime.IStatus)4 LayoutTplDescriptorHelper (com.liferay.ide.layouttpl.core.operation.LayoutTplDescriptorHelper)3