Search in sources :

Example 1 with Rule

use of org.omegat.core.segmentation.Rule in project omegat by omegat-org.

the class SegmentationRulesModel method moveRowUp.

/**
 * Moves a segmentation rule up an order.
 */
public void moveRowUp(int row) {
    Rule rulePrev = rules.remove(row - 1);
    rules.add(row, rulePrev);
    fireTableRowsUpdated(row - 1, row);
}
Also used : Rule(org.omegat.core.segmentation.Rule)

Example 2 with Rule

use of org.omegat.core.segmentation.Rule in project omegat by omegat-org.

the class SegmentationRulesModel method addRow.

/**
 * Adds a new empty segmentation rule.
 */
public int addRow() {
    int rows = rules.size();
    rules.add(new Rule(false, "\\.", "\\s"));
    fireTableRowsInserted(rows, rows);
    return rows;
}
Also used : Rule(org.omegat.core.segmentation.Rule)

Example 3 with Rule

use of org.omegat.core.segmentation.Rule in project omegat by omegat-org.

the class SegmentationRulesModel method moveRowDown.

/**
 * Moves a segmentation rule down an order.
 */
public void moveRowDown(int row) {
    Rule ruleNext = rules.remove(row + 1);
    rules.add(row, ruleNext);
    fireTableRowsUpdated(row, row + 1);
}
Also used : Rule(org.omegat.core.segmentation.Rule)

Example 4 with Rule

use of org.omegat.core.segmentation.Rule in project omegat by omegat-org.

the class SegmentationRulesModel method moveRowToBottom.

/**
 * Moves a segmentation rule to bottom.
 */
public void moveRowToBottom(int row) {
    Rule ruleCurrent = rules.remove(row);
    rules.add(ruleCurrent);
    fireTableRowsUpdated(row, rules.size());
}
Also used : Rule(org.omegat.core.segmentation.Rule)

Example 5 with Rule

use of org.omegat.core.segmentation.Rule in project omegat by omegat-org.

the class SegmentationRulesModel method moveRowFirst.

/**
 * Moves a segmentation rule to top.
 */
public void moveRowFirst(int row) {
    Rule ruleCurrent = rules.remove(row);
    rules.add(0, ruleCurrent);
    fireTableRowsUpdated(0, row);
}
Also used : Rule(org.omegat.core.segmentation.Rule)

Aggregations

Rule (org.omegat.core.segmentation.Rule)8 ArrayList (java.util.ArrayList)3 Language (org.omegat.util.Language)3 HashMap (java.util.HashMap)1 Map (java.util.Map)1 Matcher (java.util.regex.Matcher)1 EntryKey (org.omegat.core.data.EntryKey)1 ExternalTMX (org.omegat.core.data.ExternalTMX)1 DefaultTranslationsIterator (org.omegat.core.data.IProject.DefaultTranslationsIterator)1 MultipleTranslationsIterator (org.omegat.core.data.IProject.MultipleTranslationsIterator)1 PrepareTMXEntry (org.omegat.core.data.PrepareTMXEntry)1 SourceTextEntry (org.omegat.core.data.SourceTextEntry)1 TMXEntry (org.omegat.core.data.TMXEntry)1 FuzzyMatcher (org.omegat.core.matching.FuzzyMatcher)1 NearString (org.omegat.core.matching.NearString)1