Code Monkey home page Code Monkey logo

Comments (20)

angelozerr avatar angelozerr commented on June 11, 2024

I think we should manage CSS import :

  • with extension point.
  • with user preferences by selecting several folders.

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

Yes agreed, similar to how tern.java has the script paths per-project, you
could per-project set the css paths.

So either one approach would be good enough for our purposes at Liferay.

On Fri, Sep 12, 2014 at 2:57 PM, Angelo [email protected] wrote:

I think we should manage CSS import :

  • with extension point.
  • with user preferences by selecting several folders.


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

If I provide an extension point, Liferay IDE will be linked a lot of this project. is it not dangerous?

My problem today is the name of the plugin : see my explanation at https://github.com/angelozerr/eclipse-wtp-htmlcss#user-content-why-orgeclipseawsthtmlcssui

from eclipse-wtp-webresources.

kaloyan-raev avatar kaloyan-raev commented on June 11, 2024

@angelozerr did you open an Eclipse bug for this sorting issue?

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

Well for now it is not a problem but I just hope once this feature is
contributed to eclipse there is a way to make it more flexible and I wanted
to mention it now.

On Fri, Sep 12, 2014 at 3:22 PM, Angelo [email protected] wrote:

If I provide an extension, Liferay IDE will be linked a lot of this
project. is it not dangerous?

My problem today is the name of the plugin : see my explanation at
https://github.com/angelozerr/eclipse-wtp-htmlcss#user-content-why-orgeclipseawsthtmlcssui


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

@angelozerr did you open an Eclipse bug for this sorting issue?

@kaloyan-raev I have created it. See https://bugs.eclipse.org/bugs/show_bug.cgi?id=444189

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

Btw, the project container as a default container for possible css files is
good enough for my use-case, thanks.

On Tue, Sep 16, 2014 at 4:17 AM, Angelo [email protected] wrote:

@angelozerr https://github.com/angelozerr did you open an Eclipse bug
for this sorting issue?

@kaloyan-raev https://github.com/kaloyan-raev I have created it. See
https://bugs.eclipse.org/bugs/show_bug.cgi?id=444189


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

@gamerson I'm changing that to improve performance. I will explain you more when I will have cleaned my code and commited.

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

So will there be a way to contribute other stylesheets that are not even in
the project? i.e. with liferay portlets, bootstrap css is available by
default, so it would be great if the bootstrap css file could be fed into
the proposals.

On Wed, Sep 17, 2014 at 3:49 PM, Angelo [email protected] wrote:

@gamerson https://github.com/gamerson I'm changing that to improve
performance. I will explain you more when I will have cleaned my code and
commited.


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

where comes from bootstrap css ?

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

The bootstrap css is coming from inside the liferay portal's root webapp so
by the time that the developer's portlet is rendered there is bootstrap css
classes available.

On Thu, Sep 18, 2014 at 9:36 PM, Angelo [email protected] wrote:

where comes from bootstrap css ?


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

If I unedrstand bootstrap css is not inside workspace. So I suppose you wish to load bootstrap CSS from file system where portal is installed. Is that?

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

If bootstrap css is in your workspace, you can :

package com.liferay.ide.webresources;

import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.IResource;
import org.eclipse.wst.html.webresources.core.WebResourceType;
import org.eclipse.wst.html.webresources.core.providers.AbstractWebResourcesProvider;
import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;

public class BootstrapCSSProvider extends AbstractWebResourcesProvider {

    @Override
    public IResource[] getResources(IDOMNode htmlNode, IFile htmlFile,
            WebResourceType resourceType) {
        IProject project = htmlFile.getProject();
        IFile f = // use some preferences project to retrieve bootstrap.css =>  project.getFile("bootstrap.css");
        if (f.exists()) {
            IResource[] resources = new IResource[1];
            resources[0] = f;
            return resources;
        }
        return null;
    }
}

Declare extension point like this :

    <extension
              point="org.eclipse.a.wst.html.webresources.core.webResourcesProviders">
     <provider
           class="com.liferay.ide.webresources.BootstrapCSSProvider"
           types="css">
     </provider>
    </extension>

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

Thanks for this tip, but the bootstrap files live inside the portal root
war. So in order to use this I would have to make a shadow copy of it
somewhere in the user's workspace, like in a hidden project with a linked
resource or something like that. Thanks.

On Fri, Sep 19, 2014 at 11:25 PM, Angelo [email protected] wrote:

If bootstrap css is in your workspace, you can :

package com.liferay.ide.webresources;
import org.eclipse.core.resources.IFile;import org.eclipse.core.resources.IProject;import org.eclipse.core.resources.IResource;import org.eclipse.wst.html.webresources.core.WebResourceType;import org.eclipse.wst.html.webresources.core.providers.AbstractWebResourcesProvider;import org.eclipse.wst.xml.core.internal.provisional.document.IDOMNode;
public class BootstrapCSSProvider extends AbstractWebResourcesProvider {

@Override
public IResource[] getResources(IDOMNode htmlNode, IFile htmlFile,
        WebResourceType resourceType) {
    IProject project = htmlFile.getProject();
    IFile f = // use some preferences project to retrieve bootstrap.css =>  project.getFile("bootstrap.css");
    if (f.exists()) {
        IResource[] resources = new IResource[1];
        resources[0] = f;
        return resources;
    }
    return null;
}}

Declare extension point liek this :

<extension
          point="org.eclipse.a.wst.html.webresources.core.webResourcesProviders">
 <provider
       class="com.liferay.ide.webresources.BootstrapCSSProvider"
       types="css">
 </provider>
</extension>


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

@gamerson my question is :

  • can you use IResource to retrieve bootsrap.css. In this case you can use BootstrapCSSProvider like explained.
  • or do you need retrieve bootsrap.css from FileSystem. So in this case, I must provide a webResourcesFileSystemProviders

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

I can't easily use IResource. The only way for me to use IResource is to
copy the real bootstrap files from portal root and copy them into the
workspace somewhere (hidden of course) and then get a IResource handler for
them.

For me the webResourcesFileSystemProviders would be better as I could
directly point to the fileSystem resources.

On Mon, Sep 22, 2014 at 3:23 PM, Angelo [email protected] wrote:

@gamerson https://github.com/gamerson my question is :

  • can you use IResource to retrieve bootsrap.css. In this case you can
    use BootstrapCSSProvider like explained.
  • or do you need retrieve bootsrap.css from FileSystem. So in this
    case, I must provide a webResourcesFileSystemProviders


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

For me the webResourcesFileSystemProviders would be better as I could
directly point to the fileSystem resources.

Ok, but bootstrap.css, is included in a war. So it means that I must unzip the war portal?

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

For Liferay IDE most developers point to a portal bundle which has the war
pre-installed (exploded) so I can point directly to the portal css files.

On Mon, Sep 22, 2014 at 3:32 PM, Angelo [email protected] wrote:

For me the webResourcesFileSystemProviders would be better as I could
directly point to the fileSystem resources.

Ok, but bootstrap.css, is included a war. So it means that I must unzip
the war portal?


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

angelozerr avatar angelozerr commented on June 11, 2024

See https://github.com/angelozerr/eclipse-wtp-webresources/wiki/webResourcesProviders-Extension-Point

from eclipse-wtp-webresources.

gamerson avatar gamerson commented on June 11, 2024

Sweet, thanks for much Angelo, I'll give this a try soon and let you know
the results.

On Tue, Sep 23, 2014 at 12:30 AM, Angelo [email protected] wrote:

See
https://github.com/angelozerr/eclipse-wtp-webresources/wiki/webResourcesProviders-Extension-Point


Reply to this email directly or view it on GitHub
#4 (comment)
.

Greg Amerson
Liferay Developer Tools
Liferay, Inc. www.liferay.com

from eclipse-wtp-webresources.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.