public WalrusInfoTable(String sessionId) {
   this.sessionId = sessionId;
   this.setStyleName("euca-config-component");
   this.setSpacing(2);
   this.setVerticalAlignment(HasVerticalAlignment.ALIGN_MIDDLE);
   //		this.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_CENTER);
   Label walrusesHeader = new Label("Walrus Configuration:");
   walrusesHeader.setStyleName("euca-section-header");
   this.add(walrusesHeader);
   this.noWalrusesLabel.setText("No Walrus hosts registered");
   this.noWalrusesLabel.setStyleName("euca-greeting-disabled");
   HorizontalPanel grid_and_hint = new HorizontalPanel();
   grid_and_hint.add(this.grid);
   grid_and_hint.add(this.hint);
   this.hint.setWidth("100");
   this.add(grid_and_hint);
   HorizontalPanel hpanel = new HorizontalPanel();
   hpanel.setSpacing(2);
   hpanel.add(add_button);
   hpanel.add(new EucaButton("Save Walrus configuration", new SaveCallback(this)));
   hpanel.add(this.statusLabel);
   //		this.statusLabel.setWidth ("250");
   this.statusLabel.setText("");
   this.statusLabel.setStyleName("euca-greeting-pending");
   this.add(hpanel);
   rebuildTable();
   EucalyptusWebBackend.App.getInstance()
       .getWalrusList(this.sessionId, new GetWalrusListCallback(this));
 }
Esempio n. 2
0
  public void initialize() {
    setLayout(new GridLayout(3, false));
    Label fileNameLabel = new Label(this, SWT.NONE);
    fileNameText = new Text(this, SWT.BORDER);
    Button browseButton = new Button(this, SWT.NONE);

    fileNameLabel.setText(getLabel("feeder.file.name") + ":");

    fileNameText.setLayoutData(new GridData(160, -1));

    browseButton.setText(getLabel("feeder.file.browse"));
    browseButton.addSelectionListener(
        new SelectionAdapter() {
          public void widgetSelected(SelectionEvent e) {
            FileDialog dialog = new FileDialog(getShell());
            dialog.setText(getLabel("feeder.file.browse"));
            String fileName = dialog.open();
            if (fileName != null) {
              fileNameText.setText(fileName);
              fileNameText.setSelection(fileName.length());
            }
          }
        });

    pack();
  }
Esempio n. 3
0
  private Widget appendComment(DiscussionRecord r) {
    SmallLabel hrd =
        new SmallLabel(constants.smallCommentBy0On1Small(r.author, new Date(r.timestamp)));
    hrd.addStyleName("discussion-header");
    commentList.add(hrd);

    String[] parts = r.note.split("\n");

    if (parts.length > 0) {
      StringBuilder txtBuilder = new StringBuilder();
      for (int i = 0; i < parts.length; i++) {
        txtBuilder.append(parts[i]);
        if (i != parts.length - 1) {
          txtBuilder.append("<br/>");
        }
      }
      HTML hth = new HTML(txtBuilder.toString());
      hth.setStyleName("form-field");
      commentList.add(hth);
    } else {
      Label lbl = new Label(r.note);
      lbl.setStyleName("form-field");
      commentList.add(lbl);
    }

    commentList.add(new HTML("<br/>"));
    return hrd;
  }
Esempio n. 4
0
 /** Compute the change in depth as an edge is crossed from R to L */
 private static int depthDelta(Label label) {
   int lLoc = label.getLocation(0, Position.LEFT);
   int rLoc = label.getLocation(0, Position.RIGHT);
   if (lLoc == Location.INTERIOR && rLoc == Location.EXTERIOR) return 1;
   else if (lLoc == Location.EXTERIOR && rLoc == Location.INTERIOR) return -1;
   return 0;
 }
Esempio n. 5
0
 void write(ClassEnv e, CodeAttr ce, DataOutputStream out) throws IOException, jasError {
   if (wide) {
     target.writeWideOffset(ce, source, out);
   } else {
     target.writeOffset(ce, source, out);
   }
 }
  private Composite createAvailableList(Composite parent) {
    Composite container = new Composite(parent, SWT.NONE);
    GridLayout layout = new GridLayout();
    layout.marginWidth = 0;
    layout.marginHeight = 0;
    container.setLayout(layout);
    container.setLayoutData(new GridData());

    Label label = new Label(container, SWT.NONE);
    label.setText(PDEUIMessages.ImportWizard_DetailedPage_availableList);

    Table table = new Table(container, SWT.BORDER | SWT.MULTI | SWT.V_SCROLL);
    GridData gd = new GridData(GridData.FILL_BOTH);
    gd.heightHint = 200;
    gd.widthHint = 225;
    table.setLayoutData(gd);

    fAvailableListViewer = new TableViewer(table);
    fAvailableListViewer.setLabelProvider(new PluginImportLabelProvider());
    fAvailableListViewer.setContentProvider(new ContentProvider());
    fAvailableListViewer.setInput(PDECore.getDefault().getModelManager());
    fAvailableListViewer.setComparator(ListUtil.PLUGIN_COMPARATOR);

    return container;
  }
Esempio n. 7
0
 public static void main(String[] args) {
   Parser parser = new Parser();
   Label labels = new Label();
   String asmbly;
   int pc = 100;
   try {
     BufferedReader br = new BufferedReader(new FileReader(args[0]));
     String line;
     while ((line = br.readLine()) != null) {
       if (line.contains(":")) labels.fillLabels(line, pc);
       pc++;
     }
   } catch (Exception e) {
     System.out.println("Failed first");
   }
   try {
     BufferedReader br = new BufferedReader(new FileReader(args[0]));
     PrintWriter writer = new PrintWriter("output", "UTF-8");
     String line;
     while ((line = br.readLine()) != null) {
       asmbly = parser.parseLine(line, labels);
       writer.println(asmbly);
     }
     writer.close();
   } catch (Exception e) {
     System.out.println("Failed second");
   }
 }
 private void createUILabel(Composite container) {
   Label label = new Label(container, SWT.WRAP);
   label.setText(CSWizardMessages.RegisterCSWizardPage_label);
   GridData data = new GridData(GridData.FILL_HORIZONTAL);
   data.widthHint = 300;
   label.setLayoutData(data);
 }
 private void createUIDescriptionLabel(Composite parent) {
   Label label = new Label(parent, SWT.NONE);
   label.setText(CSWizardMessages.RegisterCSWizardPage_desc);
   int style = GridData.VERTICAL_ALIGN_BEGINNING | GridData.HORIZONTAL_ALIGN_END;
   GridData data = new GridData(style);
   label.setLayoutData(data);
 }
 protected void enableMinMax(boolean enable) {
   fMinOccurSpinner.setEnabled(enable);
   fMaxOccurSpinner.setEnabled(!fUnboundSelect.getSelection() && enable);
   fUnboundSelect.setEnabled(enable);
   fMinLabel.setEnabled(enable);
   fMaxLabel.setEnabled(enable);
 }
Esempio n. 11
0
 public void jsr(Label label) throws IOException {
   // push(-1);
   int offset = size();
   code.writeByte(168);
   label.setBranch(offset, 2);
   label.setStack(stack + 1);
 }
Esempio n. 12
0
  public OutputStream receiveUpload(String filename, String MIMEType) {
    mainTabs.setReadOnly(true);
    subTabs.setReadOnly(true);
    FileOutputStream fos = null; // Output stream to write to
    file = new File(filename);

    try {
      System.out.println(MIMEType);
      if (MIMEType.equalsIgnoreCase("text/plain")
          || MIMEType.equalsIgnoreCase(
              "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet")
          || MIMEType.equalsIgnoreCase("application/octet-stream")) {
        fos = new FileOutputStream(file);
      } else {
      }

    } catch (final java.io.FileNotFoundException e) {
      Label l = new Label("<h4 style='color:red'>" + e.getMessage() + "</h4>");
      l.setContentMode(Label.CONTENT_XHTML);
      expDetails.addComponent(l);
      e.printStackTrace();
      return null;
    } catch (final Exception e) {
      // Error while opening the file. Not reported here.
      e.printStackTrace();
      return null;
    }

    return fos; // Return the output stream to write to
  }
Esempio n. 13
0
 /** Compute the label in the appropriate orientation for this DirEdge */
 private void computeDirectedLabel() {
   final Label label = new Label(this.edge.getLabel());
   if (!this.isForward) {
     label.flip();
   }
   setLabel(label);
 }
  private void runThread() {
    try {
      while (!isFinished) {
        Thread.sleep(everyupdates);
        currentTime += 1;

        if (currentTime < taskSeconds) {
          Platform.runLater(
              () -> {
                double percentageToShow = (currentTime * 100 / taskSeconds);
                double progressPercentage = (currentTime * 1.0 / taskSeconds);

                lblStatus.setText(String.format("%s %%", Double.toString(percentageToShow)));
                prgStatus.setProgress(progressPercentage);
                lblRemainingTime.setText(
                    String.format("Remaining time: %s seconds", taskSeconds - currentTime));
              });

        } else {
          isFinished = true;
        }
      }

      listener.onProgressFinished();
    } catch (Exception ex) {

    }
  }
Esempio n. 15
0
 @Override
 public void serializeContent(XmlSerializer serializer) throws IOException {
   if (isEmpty()) return;
   SerializerUtils.addTextTag(serializer, VCardProperty.FN.toString(), getFormattedName());
   serializer.startTag(null, N_NAME);
   for (Entry<NameProperty, String> entry : name.entrySet())
     SerializerUtils.addTextTag(serializer, entry.getKey().toString(), entry.getValue());
   serializer.endTag(null, N_NAME);
   for (Entry<VCardProperty, String> entry : properties.entrySet())
     if (entry.getKey() != VCardProperty.FN)
       SerializerUtils.addTextTag(serializer, entry.getKey().toString(), entry.getValue());
   for (Photo photo : photos) photo.serialize(serializer);
   for (Address address : addresses) address.serialize(serializer);
   for (Label label : labels) label.serialize(serializer);
   for (Telephone telephone : telephones) telephone.serialize(serializer);
   for (Email email : emails) email.serialize(serializer);
   for (Logo logo : logos) logo.serialize(serializer);
   for (Sound sound : sounds) sound.serialize(serializer);
   for (Geo geo : geos) geo.serialize(serializer);
   for (Organization organization : organizations) organization.serialize(serializer);
   if (!categories.isEmpty()) {
     serializer.startTag(null, CATEGORIES_NAME);
     for (String keyword : categories)
       SerializerUtils.addTextTag(serializer, KEYWORD_NAME, keyword);
     serializer.endTag(null, CATEGORIES_NAME);
   }
   if (classification != null)
     SerializerUtils.addTextTag(serializer, CLASS_NAME, classification.toString());
   for (Key key : keys) key.serialize(serializer);
 }
  protected void beforeMyProfile(Form f) {
    Myprofile = f;
    Label l1 = (Label) findByName("propic", f);
    name = (TextField) findByName("name", Myprofile);
    index = (TextField) findByName("index", Myprofile);
    tel = (TextField) findByName("tel", Myprofile);
    addr = (TextField) findByName("addr", Myprofile);
    email = (TextField) findByName("email", Myprofile);
    group = (TextField) findByName("group", Myprofile);
    try {

      String userde[] = Splitter.Split(new String(record.getRecord(4)), "-");

      name.setText(userde[0]);
      index.setText(userde[1]);
      tel.setText(userde[2]);
      addr.setText(userde[3]);
      email.setText(userde[4]);
      group.setText(userde[5]);

      if (new String(record.getRecord(2)).equals("no")) {
        l1.setIcon(Image.createImage("/no_user.png").scaledHeight(72));

      } else {
        l1.setIcon(Image.createImage(new String(record.getRecord(2))).scaledHeight(72));
      }

      System.gc();
    } catch (Exception e) {
    }
    super.beforeMyProfile(f);
  }
Esempio n. 17
0
  @NotNull
  public static Button createLabelCheckbox(
      @NotNull Composite parent,
      @NotNull String label,
      @Nullable String tooltip,
      boolean checked,
      int style) {
    Label labelControl = createControlLabel(parent, label);
    // labelControl.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));

    final Button button = new Button(parent, SWT.CHECK | style);
    if (checked) {
      button.setSelection(true);
    }
    labelControl.addMouseListener(
        new MouseAdapter() {
          @Override
          public void mouseUp(MouseEvent e) {
            if (!button.isDisposed() && button.isVisible() && button.isEnabled()) {
              button.setSelection(!button.getSelection());
              button.notifyListeners(SWT.Selection, new Event());
            }
          }
        });

    if (tooltip != null) {
      labelControl.setToolTipText(tooltip);
      button.setToolTipText(tooltip);
    }
    return button;
  }
  protected boolean onPersonalinfoDone() {
    TextField t = (TextField) findByName("thispass", perosnl);
    TextField t2 = (TextField) findByName("nowpass", perosnl);
    TextField l = (TextField) findByName("path11", perosnl);
    int indecate = 0;
    Label l2 = (Label) findByName("Label32", perosnl);

    if (!t2.getText().equals("")) {

      if (t.getText().equals(password.getText())) {
        checkpass = t2.getText();
      } else {

        l2.setText("error password miss match");
        indecate = 1;
      }
    }
    if (l.getText() != null) {
      imgpath = l.getText();
    }
    if (indecate == 0) {
      Myprofile.show();
      // showForm("MyProfile", null);
    }

    boolean val = super.onPersonalinfoDone();
    return val;
  }
Esempio n. 19
0
 /** For each dirEdge in the star, merge the label from the sym dirEdge into the label */
 public void mergeSymLabels() {
   for (Iterator it = iterator(); it.hasNext(); ) {
     DirectedEdge de = (DirectedEdge) it.next();
     Label label = de.getLabel();
     label.merge(de.getSym().getLabel());
   }
 }
 public void setLabelVisibility(int visibility) {
   Label labelView = getLabelView();
   if (labelView != null) {
     labelView.setVisibility(visibility);
     labelView.setHandleVisibilityChanges(visibility == VISIBLE);
   }
 }
Esempio n. 21
0
  /**
   * Inserted edges are checked to see if an identical edge already exists. If so, the edge is not
   * inserted, but its label is merged with the existing edge.
   */
  protected void insertUniqueEdge(Edge e) {
    // <FIX> MD 8 Oct 03  speed up identical edge lookup
    // fast lookup
    Edge existingEdge = edgeList.findEqualEdge(e);

    // If an identical edge already exists, simply update its label
    if (existingEdge != null) {
      Label existingLabel = existingEdge.getLabel();

      Label labelToMerge = e.getLabel();
      // check if new edge is in reverse direction to existing edge
      // if so, must flip the label before merging it
      if (!existingEdge.isPointwiseEqual(e)) {
        labelToMerge = new Label(e.getLabel());
        labelToMerge.flip();
      }
      existingLabel.merge(labelToMerge);

      // compute new depth delta of sum of edges
      int mergeDelta = depthDelta(labelToMerge);
      int existingDelta = existingEdge.getDepthDelta();
      int newDelta = existingDelta + mergeDelta;
      existingEdge.setDepthDelta(newDelta);
    } else { // no matching existing edge was found
      // add this new edge to the list of edges in this graph
      // e.setName(name + edges.size());
      edgeList.add(e);
      e.setDepthDelta(depthDelta(e.getLabel()));
    }
  }
  /** <b>This will clear all AnimationListeners.</b> */
  public void hideButtonInMenu(boolean animate) {
    if (!isHidden() && getVisibility() != GONE) {
      hide(animate);

      Label label = getLabelView();
      if (label != null) {
        label.hide(animate);
      }

      getHideAnimation()
          .setAnimationListener(
              new Animation.AnimationListener() {
                @Override
                public void onAnimationStart(Animation animation) {}

                @Override
                public void onAnimationEnd(Animation animation) {
                  setVisibility(GONE);
                  getHideAnimation().setAnimationListener(null);
                }

                @Override
                public void onAnimationRepeat(Animation animation) {}
              });
    }
  }
    private void initLayout() {
        FormLayout loginForm = new FormLayout();
        loginForm.setSizeUndefined();

        loginForm.addComponent(userName = new TextField("Username"));
        loginForm.addComponent(passwordField = new PasswordField("Password"));
        loginForm.addComponent(login = new Button("Login"));
        login.addStyleName(ValoTheme.BUTTON_PRIMARY);
        login.setDisableOnClick(true);
        login.setClickShortcut(ShortcutAction.KeyCode.ENTER);
        login.addClickListener(new Button.ClickListener() {
            @Override
            public void buttonClick(Button.ClickEvent event) {
                login();
            }
        });

        VerticalLayout loginLayout = new VerticalLayout();
        loginLayout.setSizeUndefined();

        loginLayout.addComponent(loginFailedLabel = new Label());
        loginLayout.setComponentAlignment(loginFailedLabel, Alignment.BOTTOM_CENTER);
        loginFailedLabel.setSizeUndefined();
        loginFailedLabel.addStyleName(ValoTheme.LABEL_FAILURE);
        loginFailedLabel.setVisible(false);

        loginLayout.addComponent(loginForm);
        loginLayout.setComponentAlignment(loginForm, Alignment.TOP_CENTER);

        VerticalLayout rootLayout = new VerticalLayout(loginLayout);
        rootLayout.setSizeFull();
        rootLayout.setComponentAlignment(loginLayout, Alignment.MIDDLE_CENTER);
        setCompositionRoot(rootLayout);
        setSizeFull();
    }
  @Override
  public boolean onTouchEvent(MotionEvent event) {
    if (mClickListener != null && isEnabled()) {
      Label label = (Label) getTag(R.id.fab_label);
      if (label == null) return super.onTouchEvent(event);

      int action = event.getAction();
      switch (action) {
        case MotionEvent.ACTION_UP:
          if (label != null) {
            label.onActionUp();
          }
          onActionUp();
          break;

        case MotionEvent.ACTION_CANCEL:
          if (label != null) {
            label.onActionUp();
          }
          onActionUp();
          break;
      }
      mGestureDetector.onTouchEvent(event);
    }
    return super.onTouchEvent(event);
  }
Esempio n. 25
0
 /**
  * This method creates the Day title Component for the Month View
  *
  * @param day the relevant day values are 0-6 where 0 is sunday.
  * @return a Label that corresponds to the relevant Day
  */
 protected Label createDayTitle(int day) {
   String value = getUIManager().localize("Calendar." + DAYS[day], LABELS[day]);
   Label dayh = new Label(value, "CalendarTitle");
   dayh.setEndsWith3Points(false);
   dayh.setTickerEnabled(false);
   return dayh;
 }
  public void createButtonPanel(Shell dialog) {
    Composite buttonPanel = new Composite(dialog, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
    buttonPanel.setLayoutData(gridData);
    buttonPanel.setLayout(new GridLayout(4, false));

    String buttonAlign =
        System.getProperty("org.pentaho.di.buttonPosition", "right")
            .toLowerCase(); //$NON-NLS-1$ //$NON-NLS-2$

    if (!"left".equals(buttonAlign)) { // $NON-NLS-1$
      Label emptyLabel = new Label(buttonPanel, SWT.NONE);
      gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
      emptyLabel.setLayoutData(gridData);
    }
    okButton = new Button(buttonPanel, SWT.PUSH);
    okButton.setText(Messages.getString("VfsFileChooserDialog.ok")); // $NON-NLS-1$
    gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.widthHint = 90;
    okButton.setLayoutData(gridData);
    okButton.addSelectionListener(this);
    cancelButton = new Button(buttonPanel, SWT.PUSH);
    cancelButton.setText(Messages.getString("VfsFileChooserDialog.cancel")); // $NON-NLS-1$
    cancelButton.addSelectionListener(this);
    gridData = new GridData(SWT.FILL, SWT.FILL, false, false);
    gridData.widthHint = 90;
    cancelButton.setLayoutData(gridData);
    if ("center".equals(buttonAlign)) { // $NON-NLS-1$
      Label emptyLabel = new Label(buttonPanel, SWT.NONE);
      gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
      emptyLabel.setLayoutData(gridData);
    }
  }
 private Label createNoMatchingUsersLabel() {
   Label noMatchingUsersLabel = new Label(MESSAGE_NO_MATCHES);
   noMatchingUsersLabel.setPrefHeight(40);
   noMatchingUsersLabel.setPrefWidth(398);
   noMatchingUsersLabel.setAlignment(Pos.CENTER);
   return noMatchingUsersLabel;
 }
  public void createFileNamePanel(Shell dialog, String fileName) {
    Composite fileNamePanel = new Composite(dialog, SWT.NONE);
    GridData gridData = new GridData(SWT.FILL, SWT.FILL, true, false);
    fileNamePanel.setLayoutData(gridData);
    fileNamePanel.setLayout(new GridLayout(2, false));
    Label fileNameLabel = new Label(fileNamePanel, SWT.NONE);
    fileNameLabel.setText(Messages.getString("VfsFileChooserDialog.fileName")); // $NON-NLS-1$
    gridData = new GridData(SWT.FILL, SWT.CENTER, false, false);
    fileNameLabel.setLayoutData(gridData);
    fileNameText = new Text(fileNamePanel, SWT.BORDER);
    if (fileName != null) {
      fileNameText.setText(fileName);
    }
    gridData = new GridData(SWT.FILL, SWT.CENTER, true, false);
    fileNameText.setLayoutData(gridData);
    fileNameText.addKeyListener(
        new KeyListener() {

          public void keyPressed(KeyEvent arg0) {}

          public void keyReleased(KeyEvent event) {
            if (event.keyCode == SWT.CR || event.keyCode == SWT.KEYPAD_CR) {
              okPressed();
            }
          }
        });
  }
Esempio n. 29
0
  @Override
  public void initialize() {
    disputesTable = new TableView<>();
    VBox.setVgrow(disputesTable, Priority.SOMETIMES);
    disputesTable.setMinHeight(150);
    root.getChildren().add(disputesTable);

    TableColumn<Dispute, Dispute> tradeIdColumn = getTradeIdColumn();
    disputesTable.getColumns().add(tradeIdColumn);
    TableColumn<Dispute, Dispute> roleColumn = getRoleColumn();
    disputesTable.getColumns().add(roleColumn);
    TableColumn<Dispute, Dispute> dateColumn = getDateColumn();
    disputesTable.getColumns().add(dateColumn);
    TableColumn<Dispute, Dispute> contractColumn = getContractColumn();
    disputesTable.getColumns().add(contractColumn);
    TableColumn<Dispute, Dispute> stateColumn = getStateColumn();
    disputesTable.getColumns().add(stateColumn);

    disputesTable.getSortOrder().add(dateColumn);
    disputesTable.setColumnResizePolicy(TableView.CONSTRAINED_RESIZE_POLICY);
    Label placeholder = new Label("There are no open tickets");
    placeholder.setWrapText(true);
    disputesTable.setPlaceholder(placeholder);
    disputesTable.getSelectionModel().clearSelection();

    disputeChangeListener = (observableValue, oldValue, newValue) -> onSelectDispute(newValue);
  }
  public Form getSupportMe() {
    if (frmSupportMe == null) {
      // ---------------------------------------------
      // Form f = ...
      frmSupportMe = new Form("Support Me");
      frmSupportMe.setLayout(new BorderLayout());

      Image bimage = null;
      try {
        bimage = Image.createImage("/images/metaLabSmall.png");
      } catch (IOException ex) {
        ex.printStackTrace();
      }

      Label bottomText = new Label(bimage);
      bottomText.setAlignment(Component.CENTER);
      bottomText.setText("Our Logo");
      bottomText.setTextPosition(Component.BOTTOM);

      Container buttonBar = new Container(new BoxLayout(BoxLayout.X_AXIS));
      buttonBar.addComponent(new Button("Add"));
      buttonBar.addComponent(new Button("Remove"));
      buttonBar.addComponent(new Button("Edit"));
      buttonBar.addComponent(new Button("Send"));
      buttonBar.addComponent(new Button("Exit"));

      frmSupportMe.addComponent(BorderLayout.CENTER, bottomText);
      frmSupportMe.addComponent(BorderLayout.SOUTH, buttonBar);
      frmSupportMe.addCommand(mBackCommand);
      frmSupportMe.addCommandListener(this); // Use setCommandListener() with LWUIT 1.3 or earlier.
    }
    return frmSupportMe;
  }