Ejemplo n.º 1
0
  private void removeTerm() {

    TableItem[] sel = termsTableViewer.getTable().getSelection();

    if (sel.length > 0) {

      ITerm selTerm = (ITerm) (sel[0].getData());

      ITerminoConcept tc =
          ControlerFactoryImpl.getTerminoOntoControler().getCurrentTerminoConcept();

      ITerminoOntoAnnotation starTermAnnotation = getStarTermAnnotation(tc);

      if (starTermAnnotation != null) {

        if (starTermAnnotation.getValue().compareTo(selTerm.getId() + "") == 0) { // $NON-NLS-1$

          DatabaseAdapter.deleteTCAnnotation(tc, starTermAnnotation);
        }
      }

      List<ITerminoConcept> tcs = new ArrayList<ITerminoConcept>();
      tcs.add(tc);
      DatabaseAdapter.unlinkTerm(tcs, selTerm);

      updateInformation();
    }
  }
Ejemplo n.º 2
0
  private List<ISentence> getSentences() {

    List<ISentence> sentences;

    sentences = DatabaseAdapter.getSentencesFromTC(currentTerminoConcept);

    return sentences;
  }
Ejemplo n.º 3
0
    @Override
    public void propertyChange(PropertyChangeEvent arg0) {

      DatabaseAdapter.deleteSentencesFromTC(
          ControlerFactoryImpl.getTerminoOntoControler().getCurrentTerminoConcept(),
          sentencesWidget.getSelection());

      updateInformation();
    }
Ejemplo n.º 4
0
  private void removeTranslatedTerm() {
    TableItem[] sel = termsOtherLgTableViewer.getTable().getSelection();

    if (sel.length > 0) {

      ITerminoOntoAnnotation selAnnot = (ITerminoOntoAnnotation) (sel[0].getData());

      ITerminoConcept tc =
          ControlerFactoryImpl.getTerminoOntoControler().getCurrentTerminoConcept();

      DatabaseAdapter.deleteTCAnnotation(tc, selAnnot);

      updateInformation();
    }
  }
Ejemplo n.º 5
0
  private void addTerm() {

    NewTermDialog dialog = new NewTermDialog(shell, TerminologicalViewPart.this, false);
    dialog.open();

    if (dialog.getReturnCode() == IDialogConstants.OK_ID) {

      if (dialog.getTerm().compareTo("") != 0) { // $NON-NLS-1$

        ITerminoConcept tc =
            ControlerFactoryImpl.getTerminoOntoControler().getCurrentTerminoConcept();

        ITerm t =
            org.dafoe.terminology.common.DatabaseAdapter.createTermFromLabel(
                dialog.getTerm(), TERMINO_OBJECT_STATE.VALIDATED, LINGUISTIC_STATUS.TERM);

        DatabaseAdapter.linkTCWithTerm(tc, t);

        updateInformation();
      }
    }
  }
Ejemplo n.º 6
0
  private void addTranslatedTerm() {
    NewTermDialog dialog = new NewTermDialog(shell, TerminologicalViewPart.this, true);
    dialog.open();

    if (dialog.getReturnCode() == IDialogConstants.OK_ID) {

      ITerminoConcept tc =
          ControlerFactoryImpl.getTerminoOntoControler().getCurrentTerminoConcept();

      String selLanguage = dialog.getLanguage();
      String databaseAnnotation = DatabaseAdapter.LABEL_EN_ANNOTATION;

      if (selLanguage.compareTo(NewTermDialog.SPANISH) == 0) {
        databaseAnnotation = DatabaseAdapter.LABEL_SP_ANNOTATION;
      } else if (selLanguage.compareTo(NewTermDialog.ENGLISH) == 0) {
        databaseAnnotation = DatabaseAdapter.LABEL_EN_ANNOTATION;
      }

      DatabaseAdapter.createTCAnnotation(tc, databaseAnnotation, dialog.getTerm());

      updateInformation();
    }
  }
Ejemplo n.º 7
0
 public DefaultLanguageLabelProvider() {
   super();
   defaultLanguage = DatabaseAdapter.getDefaultLanguage();
 }