/* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * This file incorporates work covered by the following license notice: * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed * with this work for additional information regarding copyright * ownership. The ASF licenses this file to you under the Apache * License, Version 2.0 (the "License"); you may not use this file * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/ package com.sun.star.wizards.form;
publicvoid initialize(String[] _AllMasterFieldNames, String[] _AllSlaveFieldNames, String[][] _LinkFieldNames)
{ int SOMASTERINDEX = 1;
String[] MasterLinkNames = JavaTools.ArrayOutOfMultiDimArray(_LinkFieldNames, SOMASTERINDEX); int SOSLAVEINDEX = 0;
String[] SlaveLinkNames = JavaTools.ArrayOutOfMultiDimArray(_LinkFieldNames, SOSLAVEINDEX);
String[] ViewMasterFieldNames = addNoneFieldItemToList(_AllMasterFieldNames); // add '-undefined-'
String[] ViewSlaveFieldNames = addNoneFieldItemToList(_AllSlaveFieldNames); for (int i = 0; i < rowcount; i++)
{ super.initializeListBox(lstMasterFields[i], ViewMasterFieldNames, MasterLinkNames, i); super.initializeListBox(lstSlaveFields[i], ViewSlaveFieldNames, SlaveLinkNames, i); if (_LinkFieldNames != null)
{
toggleControlRow(i, (i <= _LinkFieldNames.length));
} else
{
toggleControlRow(i, i == 0);
}
}
}
public String[][] getLinkFieldNames(RelationController _oRelationController, String _sReferencedTableName)
{ return _oRelationController.getImportedKeyColumns(_sReferencedTableName);
}
/** * @return the LinkFieldnames of the joins. When no LinkFieldNames were selected the returned Array is empty. * When Joins were assigned duplicate a null value is returned *
*/ public String[][] getLinkFieldNames()
{ int nSelectedIndex = getMaxSelIndex();
String[][] LinkFieldNames = new String[2][nSelectedIndex + 1]; for (int i = 0; i <= nSelectedIndex; i++)
{
LinkFieldNames[0][i] = lstSlaveFields[i].getSelectedItem();
LinkFieldNames[1][i] = lstMasterFields[i].getSelectedItem();
} int iduplicate = JavaTools.getDuplicateFieldIndex(LinkFieldNames); if (iduplicate != -1)
{
String sLinkFieldsAreDuplicate = CurUnoDialog.getResource().getResText("RID_FORM_19");
String sLocLinkFieldsAreDuplicate = JavaTools.replaceSubString(sLinkFieldsAreDuplicate, LinkFieldNames[0][iduplicate], "");
sLocLinkFieldsAreDuplicate = JavaTools.replaceSubString(sLocLinkFieldsAreDuplicate, LinkFieldNames[1][iduplicate], "");
CurUnoDialog.setCurrentStep(FormWizard.SOFIELDLINKER_PAGE);
CurUnoDialog.enableNavigationButtons(true, true, true);
CurUnoDialog.showMessageBox("WarningBox", VclWindowPeerAttribute.OK, sLocLinkFieldsAreDuplicate);
CurUnoDialog.setFocus("lstSlaveFieldLink" + (iduplicate + 1)); returnnull;
} return LinkFieldNames;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.