Skip to content

Commit

Permalink
Updated gitignore file, fixed fatal error bug on server error message…
Browse files Browse the repository at this point in the history
… and made the job comments view scrollable
  • Loading branch information
coddo committed Feb 19, 2014
1 parent 0704d25 commit 80fe764
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,5 @@ DUMP/
#*.xml
*.out
*.in

build\ scripts/test.xml
Settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,9 @@ private static String sendMessage(String url, String[] messageHeaders, String[]
data.addPart(messageHeaders[i], new StringBody(encodeMessage(messages[i])));
}

return ConnectionManager.sendMessage(url, data);
String response = ConnectionManager.sendMessage(url, data);

return (response.indexOf("<!DOCTYPE") == 0) ? null : response;
}

catch (Exception ex) {
Expand Down
26 changes: 18 additions & 8 deletions src/com/coddotech/teamsubb/jobs/gui/JobWindow.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Table;
import org.eclipse.swt.widgets.TableItem;
import org.eclipse.swt.widgets.Text;

import com.coddotech.teamsubb.appmanage.model.ActivityLogger;
import com.coddotech.teamsubb.chat.model.LoggedUser;
Expand Down Expand Up @@ -107,7 +108,7 @@ public class JobWindow extends CustomWindow {
private Label jobBookedByLabel;
private Label jobBookedBy;
private Label jobCommentsLabel;
private Label jobComments;
private Text jobComments;

// help chart objects
private Label itemAcceptedColor;
Expand Down Expand Up @@ -455,7 +456,7 @@ public void performInitializations() {
jobBookedByLabel = new Label(this.jobInfoGroup, SWT.None);
jobBookedBy = new Label(this.jobInfoGroup, SWT.None);
jobCommentsLabel = new Label(this.jobInfoGroup, SWT.None);
jobComments = new Label(this.jobInfoGroup, SWT.WRAP);
jobComments = new Text(this.jobInfoGroup, SWT.WRAP | SWT.MULTI | SWT.READ_ONLY | SWT.TRANSPARENT | SWT.V_SCROLL);

// help chart items
itemAcceptedColor = new Label(this.helpChartGroup, SWT.None);
Expand Down Expand Up @@ -493,15 +494,15 @@ public void createObjectProperties() {
userJobsGroup.setText("User abilities");

jobsGroup.setLayout(jobsLayout);
jobsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 1));
jobsGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 2, 4));
jobsGroup.setText("Job lists");

jobInfoGroup.setLayout(helpLayout);
jobInfoGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 1));
jobInfoGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
jobInfoGroup.setText("Job information");

helpChartGroup.setLayout(helpLayout);
helpChartGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true));
helpChartGroup.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false, 1, 1));
helpChartGroup.setText("Help chart");

// menu bar items
Expand Down Expand Up @@ -604,6 +605,8 @@ public void createObjectProperties() {

jobComments.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, true, 1, 5));
jobComments.setFont(CustomWindow.DEFAULT_FONT);
jobComments.setBackground(this.getShell().getBackground());
// jobComments.setEnabled(false);

// help chart item
itemAcceptedColor.setText(" ");
Expand Down Expand Up @@ -702,7 +705,13 @@ private void createJobList(NotificationEntity notif) {
}

catch (Exception ex) {
return;
}

finally {
if (jobs != null)
if (jobs.size() == 0)
this.clearJobInformation();
}

for (Job job : acceptedJobs) {
Expand Down Expand Up @@ -748,8 +757,11 @@ private boolean isInList(Job job) {
}

private void updateJobInfo(Job job) {
if (job == null)
if (job == null) {
this.clearJobInformation();

return;
}

this.jobType.setText(Job.DEFAULT_JOB_TYPES[job.getType()]);
this.jobStartDate.setText(job.getStartDate());
Expand Down Expand Up @@ -836,8 +848,6 @@ private void generateUserInfo() {
/**
* Clears the fields that display the information for a selected job in the list
*/
@SuppressWarnings ("unused")
@Deprecated
private void clearJobInformation() {
this.jobType.setText("");
this.jobStartDate.setText("");
Expand Down

0 comments on commit 80fe764

Please sign in to comment.