Search in sources :

Example 6 with ITableFilter

use of org.hibernate.eclipse.console.model.ITableFilter in project jbosstools-hibernate by jbosstools.

the class DOMReverseEngineeringDefinition method removeAllTableFilters.

public void removeAllTableFilters() {
    List list = getTableFiltersList();
    for (java.util.Iterator it = list.iterator(); it.hasNext(); ) {
        ITableFilter filter = (ITableFilter) it.next();
        removeTableFilter(filter);
    }
}
Also used : ITableFilter(org.hibernate.eclipse.console.model.ITableFilter) ArrayList(java.util.ArrayList) List(java.util.List)

Example 7 with ITableFilter

use of org.hibernate.eclipse.console.model.ITableFilter in project jbosstools-hibernate by jbosstools.

the class NewReverseEngineeringFileWizard method openContentStream.

private InputStream openContentStream() {
    StringWriter sw = new StringWriter();
    sw.write(// $NON-NLS-1$
    "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n" + // $NON-NLS-1$
    "<!DOCTYPE hibernate-reverse-engineering PUBLIC \"-//Hibernate/Hibernate Reverse Engineering DTD 3.0//EN\" \"http://hibernate.org/dtd/hibernate-reverse-engineering-3.0.dtd\" >\r\n" + // $NON-NLS-1$
    "\r\n" + // $NON-NLS-1$
    "<hibernate-reverse-engineering>\r\n");
    ITableFilter[] filters = tableFilterWizardPage.getTableFilters();
    for (int i = 0; i < filters.length; i++) {
        ITableFilter filter = filters[i];
        // $NON-NLS-1$
        sw.write("  <table-filter");
        if (!".*".equals(filter.getMatchCatalog())) {
            // $NON-NLS-1$
            // $NON-NLS-1$//$NON-NLS-2$
            sw.write(" match-catalog=\"" + filter.getMatchCatalog() + "\"");
        }
        if (!".*".equals(filter.getMatchSchema())) {
            // $NON-NLS-1$
            // $NON-NLS-1$ //$NON-NLS-2$
            sw.write(" match-schema=\"" + filter.getMatchSchema() + "\"");
        }
        // $NON-NLS-1$//$NON-NLS-2$
        sw.write(" match-name=\"" + filter.getMatchName() + "\"");
        if (filter.getExclude().booleanValue()) {
            // $NON-NLS-1$ //$NON-NLS-2$
            sw.write(" exclude=\"" + filter.getExclude().booleanValue() + "\"");
        }
        // $NON-NLS-1$
        sw.write("/>\r\n");
    }
    // $NON-NLS-1$
    sw.write("</hibernate-reverse-engineering>");
    try {
        // $NON-NLS-1$
        return new ByteArrayInputStream(sw.toString().getBytes("UTF-8"));
    } catch (UnsupportedEncodingException uec) {
        HibernateConsolePlugin.getDefault().logErrorMessage(HibernateConsoleMessages.NewReverseEngineeringFileWizard_problems_converting_to_utf8, uec);
        return new ByteArrayInputStream(sw.toString().getBytes());
    }
}
Also used : StringWriter(java.io.StringWriter) ByteArrayInputStream(java.io.ByteArrayInputStream) ITableFilter(org.hibernate.eclipse.console.model.ITableFilter) UnsupportedEncodingException(java.io.UnsupportedEncodingException)

Example 8 with ITableFilter

use of org.hibernate.eclipse.console.model.ITableFilter in project jbosstools-hibernate by jbosstools.

the class TableFilterLabelProvider method getColumnText.

public String getColumnText(Object element, int columnIndex) {
    ITableFilter tf = (ITableFilter) element;
    // $NON-NLS-1$
    String result = "";
    switch(columnIndex) {
        case 0:
            return result;
        case 1:
            return tf.getMatchCatalog();
        case 2:
            return tf.getMatchSchema();
        case 3:
            return tf.getMatchName();
        default:
            return result;
    }
}
Also used : ITableFilter(org.hibernate.eclipse.console.model.ITableFilter)

Aggregations

ITableFilter (org.hibernate.eclipse.console.model.ITableFilter)8 TableItem (org.eclipse.swt.widgets.TableItem)3 ByteArrayInputStream (java.io.ByteArrayInputStream)1 StringWriter (java.io.StringWriter)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 ISelection (org.eclipse.jface.viewers.ISelection)1 StructuredSelection (org.eclipse.jface.viewers.StructuredSelection)1 ConsoleConfiguration (org.hibernate.console.ConsoleConfiguration)1 TableContainer (org.hibernate.eclipse.console.workbench.TableContainer)1 IColumn (org.jboss.tools.hibernate.runtime.spi.IColumn)1 ITable (org.jboss.tools.hibernate.runtime.spi.ITable)1