How to make eclipse auto-complete code automatically without pressing Ctrl+space?

Asked

Viewed 5,090 times

4

<ui:define name="menu">
    <ui:include src="/includes/menuPrincipal.xhtml"></ui:include>
</ui:define>

<ui:define name="conteudo">
    <h:form id="frmFabListagem">
        <p:dataTable id="tblFabricantes" emptyMessage="Nenhum registro encontrado"
            value="#{MBFrabicante.itens}" var="item" paginator="true" rows="10">

            <f:facet name="header">
                Fabricante - listagem
            </f:facet>

            <p:column headerText="Código" sortBy="#{item.codigo}"
                filterBy="#{item.codigo}">
                <h:outputText value="#{item.codigo}" />
            </p:column>

            <p:column headerText="Descrição">
                <h:outputText value="#{item.descricao}"></h:outputText>
            </p:column>

            <p:column headerText="Opções">
                <p:commandButton icon="ui-icon-trash" actionListener="#{MBFrabicante.prepararExcluir}"
                                                      oncomplete="PF('dlgFabExcluir').show();" 
                                                      update=":frmFabExcluir:pnlFabExcluir" /><!-- os ícones são do jquery ui -->
            </p:column>

            <f:facet name="footer">
            <p:commandButton value="Novo" actionListener="#{MBFrabicante.prepararNovo}" 
                                          oncomplete="PF('teste').show();"/>
            </f:facet>
        </p:dataTable>
    </h:form>
    <p:dialog widgetVar="teste" resizable="false" header="Fabricante - Novo"
        modal="true" appendTo="@(body)">
    <h:form id="frmFabNovo">
        <h:panelGrid columns="2" id="pnlFabNovo">
            <p:outputLabel value="Descrição: "></p:outputLabel>
            <p:inputText size="30" maxlength="50" value="#{MBFrabicante.fabricante.descricao}" />
        </h:panelGrid>
        <h:panelGrid columns="2">
            <p:commandButton value="Gravar" actionListener="#{MBFrabicante.novo}" 
                                            oncomplete="PF('teste').hide();" 
                                            update=":frmFabListagem:tblFabricantes :msgGlobal" />
            <p:commandButton value="Cancelar" onclick="PF('dlgFabNovo').hide();" />
        </h:panelGrid>
    </h:form>
</p:dialog>

<!-- modal true - ele trava a janela de baixo
     appendTo - 
 -->
<p:dialog widgetVar="dlgFabExcluir" closable="false"
          draggable="false" resizable="false"
          modal="true" appendTo="@(body)"
          header="Fabricante - Excluir">
    <h:form id="frmFabExcluir">
        <h:panelGrid id="pnlFabExcluir" columns="2">
            <h:outputText value="código: "></h:outputText>
            <h:outputText value="#{MBFrabicante.fabricante.codigo}" />

            <h:outputText value="Descriçao: "></h:outputText>
            <h:outputText value="#{MBFrabicante.fabricante.descricao}" />
        </h:panelGrid>
        <h:panelGrid columns="2">
            <p:commandButton value="Excluir" actionListener="#{MBFrabicante.excluir}"
                             oncomplete="PF('dlgFabExcluir').hide();" 
                             update=":frmFabListagem:tblFabricantes :msgGlobal"/>
            <p:commandButton value="Cancelar" onclick="PF('dlgFabExcluir').hide();" />
        </h:panelGrid>
    </h:form>
</p:dialog>
<!--  -->
<p:dialog widgetVar="dlgFabEditar" closable="false" 
          draggable="false" resizable="false"
          modal="true" appendTo="@(body)"
          header="Fabricante - Editar">
          <h:form id="frmFabEditar">
            <h:panelGrid id="pnlFabEditar" columns="2">
                <p:outputLabel value="Código: "></p:outputLabel>
                <h:outputText value="#{MBFrabicante.fabricante.codigo}"></h:outputText>
                <p:outputLabel value="Descrição: " />
                <p:inputText value="#{MBFrabicante.fabricante.descricao}"
                size="30" maxlength="50" />
            </h:panelGrid>
            <h:panelGrid columns="2">
                <p:commandButton value="Editar" />
                <p:commandButton value="Cancelar" />
            </h:panelGrid>  
          </h:form>
</p:dialog>

</ui:define>

3 answers

2

Auto Activation triggers for Java for "abcdefghijklmnopqrstuvxwyz."

1

Go on

Window -> Preferences -> Java/Editor/Content Assist

In "Auto Activation"
Edit the Auto Activation triggers for Java field for "abcdefghijklmnopqrstuvxwyz."

So pressing any key it will open the auto complete window.

0

Go to window / properties / facets / include jsf facet 2.

Hence it should give an error saying that you have to put a jsf2 lib.

If you are putting lib point it, in case you are on the server put the disable option if I am not mistaken.

Finally der apply.

  • I didn’t find the facets option =(

  • What is your eclipse.

  • Eclipse Luna SR1 x64

Browser other questions tagged

You are not signed in. Login or sign up in order to post.