コード例 #1
0
  public void createButtonsBar(Container content) {
    JPanel panel = new JPanel(new FlowLayout(FlowLayout.LEFT));
    content.add(panel, BorderLayout.NORTH);

    buildMapIndex = new JCheckBox();
    buildMapIndex.setText(Messages.getString("OsmExtractionUI.BUILD_MAP")); // $NON-NLS-1$
    panel.add(buildMapIndex);
    buildMapIndex.setSelected(true);

    buildPoiIndex = new JCheckBox();
    buildPoiIndex.setText(Messages.getString("OsmExtractionUI.BUILD_POI")); // $NON-NLS-1$
    panel.add(buildPoiIndex);
    buildPoiIndex.setSelected(true);

    buildAddressIndex = new JCheckBox();
    buildAddressIndex.setText(Messages.getString("OsmExtractionUI.BUILD_ADDRESS")); // $NON-NLS-1$
    panel.add(buildAddressIndex);
    buildAddressIndex.setSelected(true);

    normalizingStreets = new JCheckBox();
    normalizingStreets.setText(
        Messages.getString("OsmExtractionUI.NORMALIZE_STREETS")); // $NON-NLS-1$
    panel.add(normalizingStreets);
    normalizingStreets.setSelected(true);

    buildTransportIndex = new JCheckBox();
    buildTransportIndex.setText(
        Messages.getString("OsmExtractionUI.BUILD_TRANSPORT")); // $NON-NLS-1$
    panel.add(buildTransportIndex);
    buildTransportIndex.setSelected(true);
  }
コード例 #2
0
  /**
   * Creates the geomerty input tabbed page
   *
   * @param tabbedPane The TabbedPane to add the tab to
   */
  private void getGeometryInput(JTabbedPane tabbedPane) {
    JPanel geometryInput = new JPanel(new GridBagLayout());

    GridBagConstraints gbc = new GridBagConstraints();
    gbc.gridwidth = REMAINDER;
    gbc.fill = BOTH;
    gbc.anchor = NORTHWEST;
    gbc.weighty = 1.0;

    chainwheelGeometryInput.addContentChangeListener(this);
    geometryInput.add(chainwheelGeometryInput, gbc);

    sprocketGeometryInput.addContentChangeListener(this);
    geometryInput.add(sprocketGeometryInput, gbc);

    generalGeometryInput.addContentChangeListener(this);
    geometryInput.add(generalGeometryInput, gbc);

    driveTrainDrawing.addContentChangeListener(this);
    driveTrainOutput.addContentChangeListener(this);

    tabbedPane.addTab(
        Messages.getString("GeometryDetails"),
        null,
        geometryInput,
        Messages.getString("GeometryDetailsTip"));
  }
コード例 #3
0
 /** Method edit employee on database and edit on employee table */
 private void editEmp() {
   parent.doBlur();
   // Get Id employee selected
   String empID = view.getTblEmp().getValueAt(view.getTblEmp().getSelectedRow(), 0).toString();
   // Get employee from database
   Employee emp = AccessEmp.getInstance().getEmpInfo(new Integer(empID));
   // Create instance of Employee edit dialog and display it
   editEmp = new EditEmployeeController(new EditEmployeeDialog(parent.getView()), emp);
   editEmp.getView().setVisible(true);
   // Update data on database
   if (editEmp.getEmp() != null) {
     if (AccessEmp.getInstance().editEmp(editEmp.getEmp())) {
       JOptionPane.showMessageDialog(
           view,
           Messages.getString("EmployeeController.14"), // $NON-NLS-1$
           Messages.getString("EmployeeController.15"),
           JOptionPane.INFORMATION_MESSAGE);
       // Remove old data on table model
       empModel.removeRow(view.getTblEmp().getSelectedRow());
       // Add new row
       empModel.addRow(emp.toVector());
     } else {
       JOptionPane.showMessageDialog(
           view,
           Messages.getString("EmployeeController.16") // $NON-NLS-1$
               + Messages.getString("EmployeeController.17"),
           Messages.getString("EmployeeController.18"), // $NON-NLS-1$
           JOptionPane.ERROR_MESSAGE);
     }
   }
   parent.doBlur();
   // Set selection to employee book
   view.getTblEmp().changeSelection(view.getTblEmp().getRowCount() - 1, 0, false, false);
 }
コード例 #4
0
ファイル: Native2ASCII.java プロジェクト: nmldiegues/jvm-stm
  private Parser createParser() {
    Parser result = new ClasspathToolParser("native2ascii", true); // $NON-NLS-1$
    result.setHeader(Messages.getString("Native2ASCII.Usage")); // $NON-NLS-1$

    result.add(
        new Option(
            "encoding",
            Messages.getString("Native2ASCII.EncodingHelp"),
            Messages.getString(
                "Native2ASCII.EncodingArgName")) //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
        {
          public void parsed(String argument) throws OptionException {
            if (encoding != null)
              throw new OptionException(
                  Messages.getString("Native2ASCII.EncodingSpecified")); // $NON-NLS-1$
            encoding = argument;
          }
        });
    result.add(
        new Option(
            "reverse", Messages.getString("Native2ASCII.ReverseHelp")) // $NON-NLS-1$ //$NON-NLS-2$
        {
          public void parsed(String argument) throws OptionException {
            reversed = true;
          }
        });

    return result;
  }
コード例 #5
0
ファイル: RnFilterDialog.java プロジェクト: jsigle/ch.elexis
 @Override
 public void create() {
   super.create();
   setTitle(Messages.getString("RnFilterDialog.billsFilterCaption")); // $NON-NLS-1$
   setMessage(Messages.getString("RnFilterDialog.billsFilterMessage")); // $NON-NLS-1$
   getShell().setText(Messages.getString("RnFilterDialog.billsList")); // $NON-NLS-1$
 }
コード例 #6
0
    public void actionPerformed(final ActionEvent e) {
      final KettleQueryEntry kettleQueryEntry = (KettleQueryEntry) queryNameList.getSelectedValue();
      final KettleTransFromFileProducer fileProducer = kettleQueryEntry.createProducer();
      final KettleDataFactory dataFactory = new KettleDataFactory();
      dataFactory.setQuery(kettleQueryEntry.getName(), fileProducer);

      try {
        DataFactoryEditorSupport.configureDataFactoryForPreview(dataFactory, designTimeContext);

        final DataPreviewDialog previewDialog = new DataPreviewDialog(KettleDataSourceDialog.this);

        final KettlePreviewWorker worker =
            new KettlePreviewWorker(dataFactory, kettleQueryEntry.getName());
        previewDialog.showData(worker);

        final ReportDataFactoryException factoryException = worker.getException();
        if (factoryException != null) {
          ExceptionDialog.showExceptionDialog(
              KettleDataSourceDialog.this,
              Messages.getString("KettleDataSourceDialog.PreviewError.Title"),
              Messages.getString("KettleDataSourceDialog.PreviewError.Message"),
              factoryException);
        }
      } catch (Exception ex) {
        ExceptionDialog.showExceptionDialog(
            KettleDataSourceDialog.this,
            Messages.getString("KettleDataSourceDialog.PreviewError.Title"),
            Messages.getString("KettleDataSourceDialog.PreviewError.Message"),
            ex);
      }
    }
コード例 #7
0
ファイル: AdminApiImpl.java プロジェクト: zancapture/Rapture
 /** Some type specific calls */
 @Override
 public void deleteUser(CallingContext context, String userName) {
   checkParameter("User", userName); // $NON-NLS-1$
   // Assuming the userName is not "you", mark the user as inactive
   if (userName.equals(context.getUser())) {
     throw RaptureExceptionFactory.create(
         HttpURLConnection.HTTP_BAD_REQUEST,
         Messages.getString("Admin.NoDeleteYourself")); // $NON-NLS-1$
   }
   log.info(Messages.getString("Admin.RemovingUser") + userName); // $NON-NLS-1$
   RaptureUser usr = getUser(context, userName);
   if (!usr.getInactive()) {
     if (usr.getHasRoot()) {
       throw RaptureExceptionFactory.create(
           HttpURLConnection.HTTP_BAD_REQUEST,
           Messages.getString("Admin.NoDeleteRoot")); // $NON-NLS-1$
     }
     usr.setInactive(true);
     RaptureUserStorage.add(
         usr,
         context.getUser(),
         Messages.getString("Admin.Made")
             + userName
             + Messages.getString("Admin.Inactive")); // $NON-NLS-1$ //$NON-NLS-2$
   }
 }
コード例 #8
0
 // Note that changeReferences assumes that the number of the source/patch
 // has *already been set*.  If this is not true, it will simply do nothing
 public void changeReferences(int oldPatchNumber) {
   Specfile specfile = this.getSpecfile();
   Pattern patchPattern;
   if (oldPatchNumber == 0) {
     patchPattern =
         Pattern.compile("%patch" + oldPatchNumber + "|%patch"); // $NON-NLS-1$ //$NON-NLS-2$
   } else {
     patchPattern = Pattern.compile("%patch" + oldPatchNumber); // $NON-NLS-1$
   }
   for (int lineNumber : getLinesUsed()) {
     String line;
     try {
       line = specfile.getLine(lineNumber);
       Matcher patchMatcher = patchPattern.matcher(line);
       if (!patchMatcher.find()) {
         System.out.println(
             Messages.getString("SpecfileSource.0") + patchPattern.pattern()); // $NON-NLS-1$
         //					throw new BadLocationException("can't match " + patchPattern);
       }
       specfile.changeLine(
           lineNumber,
           line.replaceAll(
               patchPattern.pattern(),
               Messages.getString("SpecfileSource.1") + number)); // $NON-NLS-1$
     } catch (BadLocationException e) {
       SpecfileLog.logError(e);
     }
   }
 }
コード例 #9
0
  // Load user with login from repository, don't verify password...
  public UserInfo(Repository rep, String login) throws KettleException {
    try {
      long id_profile;

      setID(rep.getUserID(login));
      if (getID() > 0) {
        RowMetaAndData r = rep.getUser(getID());
        if (r != null) {
          this.login = r.getString("LOGIN", null);
          password = Encr.decryptPassword(r.getString("PASSWORD", null));
          name = r.getString("NAME", null);
          description = r.getString("DESCRIPTION", null);
          enabled = r.getBoolean("ENABLED", false);
          id_profile = r.getInteger("ID_PROFILE", 0);
          profile = new ProfileMeta(rep, id_profile);
        } else {
          setID(-1L);
          throw new KettleDatabaseException(
              Messages.getString("UserInfo.Error.UserNotFound", login));
        }
      } else {
        setID(-1L);
        throw new KettleDatabaseException(Messages.getString("UserInfo.Error.UserNotFound", login));
      }
    } catch (KettleDatabaseException dbe) {
      rep.log.logError(
          toString(), Messages.getString("UserInfo.Error.UserNotLoaded", login, dbe.getMessage()));
      throw new KettleException(Messages.getString("UserInfo.Error.UserNotLoaded", login, ""), dbe);
    }
  }
コード例 #10
0
  private void makeActions() {
    newPatientAction =
        new Action() {
          public void run() {
            openPatientenDialog();
          }
        };
    newPatientAction.setText(
        Messages.getString("WeisseSeitenSearchView.popup.newPatient")); // $NON-NLS-1$
    newPatientAction.setToolTipText(
        Messages.getString("WeisseSeitenSearchView.tooltip.newPatient")); // $NON-NLS-1$
    newPatientAction.setImageDescriptor(Images.IMG_PERSON_ADD.getImageDescriptor());

    newKontaktAction =
        new Action() {
          public void run() {
            openKontaktDialog();
          }
        };
    newKontaktAction.setText(
        Messages.getString("WeisseSeitenSearchView.popup.newKontakt")); // $NON-NLS-1$
    newKontaktAction.setToolTipText(
        Messages.getString("WeisseSeitenSearchView.tooltip.newKontakt")); // $NON-NLS-1$
    newKontaktAction.setImageDescriptor(Images.IMG_NEW.getImageDescriptor());
  }
コード例 #11
0
 public void observe(nsIConsoleMessage message) {
   nsIScriptError error =
       (nsIScriptError) message.queryInterface(nsIScriptError.NS_ISCRIPTERROR_IID);
   if (error == null) {
     return;
   }
   if (browser == null || browser.isDisposed()) {
     return;
   }
   long flag = error.getFlags();
   if ((flag == nsIScriptError.errorFlag || flag == nsIScriptError.exceptionFlag)
       && error.getSourceName().equals(internalGetUrl())) {
     errorCount++;
     if (errorCount == 1) {
       String errorMessage =
           MessageFormat.format(
               Messages.getString("FirefoxBrowser.Error"),
               new Object[] {errorCount}); // $NON-NLS-1$
       errorIcon.setImage(Activator.getDefault().getImage(Activator.ERRORS_IMG_ID));
       errorLabel.setText(errorMessage);
       errorLabel.setToolTipText(
           Messages.getString("FirefoxBrowser.Errors_In_Page")); // $NON-NLS-1$
       errorIcon.setToolTipText(errorLabel.getToolTipText());
     } else {
       String errorMessage =
           MessageFormat.format(
               Messages.getString("FirefoxBrowser.Errors"),
               new Object[] {errorCount}); // $NON-NLS-1$
       errorLabel.setText(errorMessage);
     }
     errors.layout(true, true);
     errors.getParent().layout(true, true);
   }
 }
コード例 #12
0
  protected void createBasicOptions(Composite top) {
    Group basicGroup = new Group(top, SWT.NONE);
    basicGroup.setLayout(new GridLayout());
    basicGroup.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
    basicGroup.setText(Messages.getString("ValgrindOptionsTab.Basic_Options")); // $NON-NLS-1$

    Composite basicTop = new Composite(basicGroup, SWT.NONE);
    basicTop.setLayout(new GridLayout(2, true));
    basicTop.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    traceChildrenButton = new Button(basicTop, SWT.CHECK);
    traceChildrenButton.setText(
        Messages.getString("ValgrindOptionsTab.trace_children")); // $NON-NLS-1$
    traceChildrenButton.addSelectionListener(selectListener);
    traceChildrenButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    // Must be on to prevent mangled XML output
    childSilentButton = new Button(basicTop, SWT.CHECK);
    childSilentButton.setText(Messages.getString("ValgrindOptionsTab.child_silent")); // $NON-NLS-1$
    childSilentButton.setSelection(true);
    childSilentButton.setEnabled(false);
    childSilentButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    runFreeresButton = new Button(basicTop, SWT.CHECK);
    runFreeresButton.setText(Messages.getString("ValgrindOptionsTab.run_freeres")); // $NON-NLS-1$
    runFreeresButton.addSelectionListener(selectListener);
    runFreeresButton.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
  }
コード例 #13
0
    /* (non-Javadoc)
     * @see java.lang.Runnable#run()
     */
    public void run() {

      // No token could be found, so create one

      String title = this.request.getRequester();
      if (title == null) {
        title = Messages.getString("UIAuthTokenProvider.req_token_title"); // $NON-NLS-1$
      }

      String message = this.request.getPurpose();
      if (message == null) {
        message = Messages.getString("UIAuthTokenProvider.new_token_question"); // $NON-NLS-1$
      }

      boolean result = MessageDialog.openQuestion(UIAuthTokenProvider.this.shell, title, message);

      if (result) {
        IAuthenticationTokenDescription description = this.request.getDescription();
        String tokenWizardId = description.getWizardId();
        if (showNewTokenWizard(tokenWizardId, false, description)) {
          this.token = this.cProvider.requestToken(this.request);
        } else {
          this.exc =
              new ProblemException(ICoreProblems.AUTH_TOKEN_REQUEST_CANCELED, Activator.PLUGIN_ID);
        }
      } else {
        this.exc =
            new ProblemException(ICoreProblems.AUTH_TOKEN_REQUEST_CANCELED, Activator.PLUGIN_ID);
      }
    }
コード例 #14
0
  // Listen to the Variable... button
  public static final String getVariableName(Shell shell, VariableSpace space) {
    String keys[] = space.listVariables();
    Arrays.sort(keys);

    int size = keys.length;
    String key[] = new String[size];
    String val[] = new String[size];
    String str[] = new String[size];

    for (int i = 0; i < keys.length; i++) {
      key[i] = keys[i];
      val[i] = space.getVariable(key[i]);
      str[i] = key[i] + "  [" + val[i] + "]";
    }

    EnterSelectionDialog esd =
        new EnterSelectionDialog(
            shell,
            str,
            Messages.getString("System.Dialog.SelectEnvironmentVar.Title"),
            Messages.getString("System.Dialog.SelectEnvironmentVar.Message"));
    esd.clearModal();
    if (esd.open() != null) {
      int nr = esd.getSelectionNr();
      String var = key[nr];

      return var;
    } else {
      return null;
    }
  }
コード例 #15
0
  public void decorate(Object element, IDecoration decoration) {
    if (!(element instanceof IResource)) return;
    IResource resource = (IResource) element;
    if (!resource.exists()) return;
    IProject project = resource.getProject();
    if (project == null) {
      Log.error(
          Messages.getString("ErrorDecorator.PROJECT_FOR")
              + resource.getName()
              + Messages.getString("ErrorDecorator.IS_NULL"),
          new Throwable()); //$NON-NLS-1$ //$NON-NLS-2$
      return;
    }
    try {
      if (!project.isOpen()) return;
      project.open(null);
      if (project.hasNature(LSLProjectNature.ID)) {
        LSLProjectNature nature = (LSLProjectNature) project.getNature(LSLProjectNature.ID);

        if (nature == null) return;

        IMarker[] m =
            resource.findMarkers("lslforge.problem", true, IResource.DEPTH_INFINITE); // $NON-NLS-1$

        if (m == null || m.length == 0) return;
      } else {
        return;
      }
    } catch (CoreException e) {
      Log.error("exception caught trying to determine project nature!", e); // $NON-NLS-1$
      return;
    }

    decoration.addOverlay(descriptor, IDecoration.BOTTOM_LEFT);
  }
コード例 #16
0
public class PropertyTableModel extends AbstractTableModel {
  private static final long serialVersionUID = 1L;
  private final String[] COL_NAMES = {
    Messages.getString("PropertyTableModel.Name"), Messages.getString("PropertyTableModel.Value")
  };
  private ArrayList<SysProperty> properties = null;

  public PropertyTableModel(ArrayList<SysProperty> properties) {
    this.properties = properties;
  }

  public int getColumnCount() {
    return this.COL_NAMES.length;
  }

  public String getColumnName(int column) {
    return this.COL_NAMES[column];
  }

  public int getRowCount() {
    return this.properties.size();
  }

  public boolean isCellEditable(int rowIndex, int columnIndex) {
    return false;
  }

  public Object getValueAt(int rowIndex, int columnIndex) {
    SysProperty sysProperty = (SysProperty) this.properties.get(rowIndex);
    if (columnIndex == 0) return sysProperty.getName();

    return sysProperty.getValue();
  }
}
コード例 #17
0
  private void getTableName() {
    DatabaseMeta inf = null;
    // New class: SelectTableDialog
    int connr = wConnection.getSelectionIndex();
    if (connr >= 0) inf = transMeta.getDatabase(connr);

    if (inf != null) {
      log.logDebug(
          toString(),
          Messages.getString("UpdateDialog.Log.LookingAtConnection")
              + inf.toString()); // $NON-NLS-1$

      DatabaseExplorerDialog std =
          new DatabaseExplorerDialog(shell, SWT.NONE, inf, transMeta.getDatabases());
      std.setSelectedSchema(wSchema.getText());
      std.setSelectedTable(wTable.getText());
      std.setSplitSchemaAndTable(true);
      if (std.open() != null) {
        wSchema.setText(Const.NVL(std.getSchemaName(), ""));
        wTable.setText(Const.NVL(std.getTableName(), ""));
      }
    } else {
      MessageBox mb = new MessageBox(shell, SWT.OK | SWT.ICON_ERROR);
      mb.setMessage(
          Messages.getString("UpdateDialog.InvalidConnection.DialogMessage")); // $NON-NLS-1$
      mb.setText(Messages.getString("UpdateDialog.InvalidConnection.DialogTitle")); // $NON-NLS-1$
      mb.open();
    }
  }
コード例 #18
0
  /**
   * Try to make a database connection to the given URL. The driver should return "null" if it
   * realizes it is the wrong kind of driver to connect to the given URL. This will be common, as
   * when the JDBC driverManager is asked to connect to a given URL, it passes the URL to each
   * loaded driver in turn.
   *
   * <p>The driver should raise an SQLException if it is the right driver to connect to the given
   * URL, but has trouble connecting to the database.
   *
   * <p>The java.util.Properties argument can be used to pass arbitrary string tag/value pairs as
   * connection arguments.
   *
   * <p>My protocol takes the form:
   *
   * <PRE>
   *
   * jdbc:mysql://host:port/database
   *
   * </PRE>
   *
   * @param url the URL of the database to connect to
   * @param info a list of arbitrary tag/value pairs as connection arguments
   * @return a connection to the URL or null if it isnt us
   * @exception SQLException if a database access error occurs
   * @see java.sql.Driver#connect
   */
  public java.sql.Connection connect(String url, Properties info) throws SQLException {
    if (url != null) {
      if (StringUtils.startsWithIgnoreCase(url, LOADBALANCE_URL_PREFIX)) {
        return connectLoadBalanced(url, info);
      } else if (StringUtils.startsWithIgnoreCase(url, REPLICATION_URL_PREFIX)) {
        return connectReplicationConnection(url, info);
      }
    }

    Properties props = null;

    if ((props = parseURL(url, info)) == null) {
      return null;
    }

    try {
      Connection newConn =
          new com.mysql.jdbc.Connection(host(props), port(props), props, database(props), url);

      return newConn;
    } catch (SQLException sqlEx) {
      // Don't wrap SQLExceptions, throw
      // them un-changed.
      throw sqlEx;
    } catch (Exception ex) {
      throw SQLError.createSQLException(
          Messages.getString("NonRegisteringDriver.17") // $NON-NLS-1$
              + ex.toString()
              + Messages.getString("NonRegisteringDriver.18"), // $NON-NLS-1$
          SQLError.SQL_STATE_UNABLE_TO_CONNECT_TO_DATASOURCE);
    }
  }
コード例 #19
0
ファイル: AdminApiImpl.java プロジェクト: zancapture/Rapture
 @Override
 public void addUser(
     CallingContext context,
     String userName,
     String description,
     String hashPassword,
     String email) {
   checkParameter("User", userName); // $NON-NLS-1$
   // Does the user already exist?
   RaptureUser usr = getUser(context, userName);
   if (usr == null) {
     usr = new RaptureUser();
     usr.setUsername(userName);
     usr.setDescription(description);
     usr.setHashPassword(hashPassword);
     usr.setEmailAddress(email);
     RaptureUserHelper.validateSalt(usr);
     usr.setInactive(false);
     RaptureUserStorage.add(
         usr, context.getUser(), Messages.getString("Admin.AddedUser") + userName); // $NON-NLS-1$
   } else {
     throw RaptureExceptionFactory.create(
         HttpURLConnection.HTTP_BAD_REQUEST,
         Messages.getString("Admin.UserAlreadyExists")); // $NON-NLS-1$
   }
 }
コード例 #20
0
 private void openFichierPlat() {
   File parentDirectory;
   File fileout;
   try {
     URL url =
         this.getClass()
             .getResource(
                 Messages.getString(
                     "TableDb2.resourceRepertoireFichierSortiePlat")); //$NON-NLS-1$
     parentDirectory = new File(new URI(url.toString()));
     fileout =
         new File(
             parentDirectory,
             nomTableDb2
                 + Messages.getString("TableDb2.extensionFichierSortiePlat")); // $NON-NLS-1$
     fileout.delete();
     fileout =
         new File(
             parentDirectory,
             nomTableDb2
                 + Messages.getString("TableDb2.extensionFichierSortiePlat")); // $NON-NLS-1$
     fwPlat = new FileWriter(fileout.getAbsoluteFile(), true);
     bwPlat = new BufferedWriter(fwPlat);
   } catch (URISyntaxException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   } catch (IOException e) {
     // TODO Auto-generated catch block
     e.printStackTrace();
   }
 }
コード例 #21
0
ファイル: AdminApiImpl.java プロジェクト: zancapture/Rapture
  @Override
  public void pullRemote(CallingContext context, String raptureURIString) {
    RaptureURI internalURI = new RaptureURI(raptureURIString, Scheme.DOCUMENT);
    if (internalURI.hasDocPath()) {
      throw RaptureExceptionFactory.create(
          HttpURLConnection.HTTP_BAD_REQUEST,
          apiMessageCatalog.getMessage("NoDocPath", internalURI.toShortString())); // $NON-NLS-1$
    }
    checkParameter(NAME, internalURI.getDocPath());

    log.info(
        Messages.getString("Admin.PullPerspective")
            + Messages.getString("Admin.OnType")
            + internalURI.getDocPath() // $NON-NLS-1$ //$NON-NLS-2$
            + Messages.getString("Admin.InAuthority")
            + internalURI.getAuthority()); // $NON-NLS-1$
    // NOW this is the fun one
    // Here are the steps
    // (1) Look at the local, does it have a remote defined? If
    // so, what is the latest commit known about
    // for that remote?
    // (2) Make a remote call to retrieve the commits up to that commit from
    // the RemoteLink
    // (3) For each commit, look at all of the references, retrieve them
    // from the remote and persist them
    // into the repo.
    // (4) Update the local perspective to point at the latest commit, and
    // update the Remote commit to point at that.

    getKernel().getRepo(internalURI.getFullPath()); // $NON-NLS-1$
  }
  public GenericBeanDtoDescriptorBuilder() {

    this.properties = new LinkedList<IProperty>();

    final String label =
        Messages.getString("GenericBeanDtoDescriptorBuilder.column_n_short"); // $NON-NLS-1$
    final String labelLong =
        Messages.getString("GenericBeanDtoDescriptorBuilder.column_n_long"); // $NON-NLS-1$
    final String description =
        Messages.getString(
            "GenericBeanDtoDescriptorBuilder.description_of_column_n"); //$NON-NLS-1$

    final IPropertyBuilder propertyBuilder = CapCommonToolkit.propertyBuilder();
    propertyBuilder.setValueType(String.class).setSortable(true).setFilterable(true);
    final List<String> propertyNames = GenericBeanInitializer.ALL_PROPERTIES;
    for (int columnIndex = 0; columnIndex < propertyNames.size(); columnIndex++) {
      propertyBuilder.setName(propertyNames.get(columnIndex));
      propertyBuilder.setLabel(label.replace("%1", String.valueOf(columnIndex))); // $NON-NLS-1$
      propertyBuilder.setLabelLong(
          labelLong.replace("%1", String.valueOf(columnIndex))); // $NON-NLS-1$
      propertyBuilder.setDescription(
          description.replace("%1", String.valueOf(columnIndex))); // $NON-NLS-1$
      if (columnIndex < 80) {
        propertyBuilder.setReadonly(false);
      } else {
        propertyBuilder.setReadonly(true);
      }
      properties.add(propertyBuilder.build());
    }
  }
コード例 #23
0
 /**
  * Showing an error dialog
  *
  * @param e
  */
 private void showErrorDialog(Exception e) {
   new ErrorDialog(
       shell,
       Messages.getString("GetQueryFieldsProgressDialog.Error.Title"),
       Messages.getString("GetQueryFieldsProgressDialog.Error.Message"),
       e);
 }
コード例 #24
0
  protected void doGet(HttpServletRequest req, HttpServletResponse resp)
      throws ServletException, IOException {

    @SuppressWarnings("unchecked")
    Map<String, String[]> params = req.getParameterMap();

    HttpSession session = req.getSession(true);
    session.setAttribute(LANG, "en"); // Defaults to English //$NON-NLS-1$

    if (params.containsKey("lang")) { // $NON-NLS-1$
      String lang = params.get("lang")[0]; // $NON-NLS-1$
      Messages.setLang(lang);
      if (this.availableLanguages.contains(lang)) {
        session.setAttribute(LANG, lang);
        resp.getWriter()
            .print(
                Messages.getString("localeservlet.lang_set_to")
                    + lang
                    + "'"); //$NON-NLS-1$ //$NON-NLS-2$
      } else {
        resp.sendError(
            HttpServletResponse.SC_BAD_REQUEST,
            Messages.getString("localeservlet.lang_not_available")); // $NON-NLS-1$
      }
    } else {
      resp.sendError(
          HttpServletResponse.SC_BAD_REQUEST,
          Messages.getString("localeservlet.not_lang_parameter") // $NON-NLS-1$
              + this.availableLanguages.toString());
    }
  }
コード例 #25
0
  private MethodDeclaration createOptionSetter(PropertyDeclaration property) {
    assert property != null;
    SimpleName paramName = context.createVariableName("option"); // $NON-NLS-1$

    Type optionType = context.getFieldType(property);
    return f.newMethodDeclaration(
        new JavadocBuilder(f)
            .text(
                Messages.getString("ProjectiveModelEmitter.javadocOptionSetter"), // $NON-NLS-1$
                context.getDescription(property))
            .param(paramName)
            .text(
                Messages.getString(
                    "ProjectiveModelEmitter.javadocOptionSetterParameter"), //$NON-NLS-1$
                context.getDescription(property))
            .toJavadoc(),
        new AttributeBuilder(f).toAttributes(),
        Collections.emptyList(),
        context.resolve(void.class),
        context.getOptionSetterName(property),
        Arrays.asList(
            new FormalParameterDeclaration[] {
              f.newFormalParameterDeclaration(optionType, paramName)
            }),
        0,
        Collections.emptyList(),
        null);
  }
コード例 #26
0
ファイル: Engine.java プロジェクト: Taharqa/megamek
  /**
   * Sanity checks the engine, no negative ratings, and similar checks.
   *
   * @return true if the engine is useable.
   */
  private boolean isValidEngine() {
    if (hasFlag(
        ~(CLAN_ENGINE | TANK_ENGINE | LARGE_ENGINE | SUPERHEAVY_ENGINE | SUPPORT_VEE_ENGINE))) {
      problem.append("Flags:" + engineFlags);
      return false;
    }

    if (hasFlag(SUPPORT_VEE_ENGINE)
        && (engineType != STEAM)
        && (engineType != COMBUSTION_ENGINE)
        && (engineType != BATTERY)
        && (engineType != FUEL_CELL)
        && (engineType != SOLAR)
        && (engineType != FISSION)
        && (engineType != NORMAL_ENGINE)
        && (engineType != NONE)) {
      problem.append("Invalid Engine type for support vehicle engines!");
      return false;
    }

    if ((((int) Math.ceil(engineRating / 5) > ENGINE_RATINGS.length) || (engineRating < 0))
        && !hasFlag(SUPPORT_VEE_ENGINE)) {
      problem.append("Rating:" + engineRating);
      return false;
    }
    if ((engineRating > 400) && !hasFlag(SUPPORT_VEE_ENGINE)) {
      engineFlags |= LARGE_ENGINE;
    }

    switch (engineType) {
      case COMBUSTION_ENGINE:
      case NORMAL_ENGINE:
      case XL_ENGINE:
      case XXL_ENGINE:
      case FUEL_CELL:
      case NONE:
      case MAGLEV:
      case BATTERY:
      case SOLAR:
        break;
      case COMPACT_ENGINE:
        if (hasFlag(LARGE_ENGINE)) {
          problem.append(Messages.getString("Engine.invalidCompactLarge"));
          return false;
        }
        break;
      case LIGHT_ENGINE:
      case FISSION:
        if (hasFlag(CLAN_ENGINE)) {
          problem.append(Messages.getString("Engine.invalidSphereOnly"));
          return false;
        }
        break;
      default:
        problem.append("Type:" + engineType);
        return false;
    }

    return true;
  }
コード例 #27
0
 /**
  * Writes data out in XML format.
  *
  * @return A flag indicating the success of the operation.
  */
 private boolean writeXMLFile() {
   File selectedFile = model.getFile();
   try {
     FileOutputStream ow = new FileOutputStream(selectedFile);
     DriveTrainEncoder.encode(ow, model);
     ow.close();
     model.reset();
     return true;
   } catch (IOException iox) {
     JOptionPane.showMessageDialog(
         this,
         Messages.format("Main.15", iox.getLocalizedMessage()), // $NON-NLS-1$
         Messages.getString("Main.16"),
         JOptionPane.ERROR_MESSAGE); // $NON-NLS-1$
     return false;
   } catch (ParserConfigurationException iox) {
     JOptionPane.showMessageDialog(
         this,
         Messages.format("ParserConfigurationException", iox.getLocalizedMessage()), // $NON-NLS-1$
         Messages.getString("Main.16"),
         JOptionPane.ERROR_MESSAGE); // $NON-NLS-1$
     return false;
   } catch (TransformerException iox) {
     JOptionPane.showMessageDialog(
         this,
         Messages.format("TransformerException", iox.getLocalizedMessage()), // $NON-NLS-1$
         Messages.getString("Main.16"),
         JOptionPane.ERROR_MESSAGE); // $NON-NLS-1$
     return false;
   }
 }
コード例 #28
0
 public void init() {
   server = "localhost";
   port = "5432";
   database = Messages.getString("databasename", "realm");
   user = "******";
   password = Messages.getString("password", "realm");
 }
コード例 #29
0
  /** Search employee by Id or name */
  public void searchEmp() {
    if (!LibValid.getInstance().EmpID(view.getTxtEmpID().getText())) {
      JOptionPane.showMessageDialog(
          view,
          Messages.getString("EmployeeController.25"), // $NON-NLS-1$
          Messages.getString("EmployeeController.26"),
          JOptionPane.ERROR_MESSAGE);
    } else {
      parent.removeModel(empModel);
      new Thread(
              new Runnable() {

                @Override
                public void run() {
                  totalRow =
                      AccessEmp.getInstance()
                          .searchEmp(
                              empModel,
                              view.getTxtEmpID().getText(),
                              view.getTxtEmpName().getText(),
                              (page - 1));
                  view.getLblPage()
                      .setText(
                          Messages.getString("EmployeeController.27")
                              + page
                              + Messages.getString("Slash") // $NON-NLS-1$
                              + LibUtil.getInstance().getPage(totalRow));
                }
              })
          .start();
    }
  }
コード例 #30
0
ファイル: JobHopMeta.java プロジェクト: panbasten/imeta
 public String getDescription() {
   if (isUnconditional()) return Messages.getString("JobHopMeta.Msg.ExecNextJobEntryUncondition");
   else {
     if (getEvaluation()) return Messages.getString("JobHopMeta.Msg.ExecNextJobEntryFlawLess");
     else return Messages.getString("JobHopMeta.Msg.ExecNextJobEntryFailed");
   }
 }